mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
import unittest if cannot found unittest2
This commit is contained in:
parent
d1d82db4f7
commit
e78372f338
4 changed files with 17 additions and 6 deletions
|
|
@ -86,9 +86,9 @@ class Page(object):
|
||||||
else:
|
else:
|
||||||
self.date_format = settings['DEFAULT_DATE_FORMAT']
|
self.date_format = settings['DEFAULT_DATE_FORMAT']
|
||||||
|
|
||||||
if isinstance(self.date_format, tuple):
|
if isinstance(self.date_format, tuple):
|
||||||
locale.setlocale(locale.LC_ALL, self.date_format[0])
|
locale.setlocale(locale.LC_ALL, self.date_format[0])
|
||||||
self.date_format = self.date_format[1]
|
self.date_format = self.date_format[1]
|
||||||
|
|
||||||
if hasattr(self, 'date'):
|
if hasattr(self, 'date'):
|
||||||
if platform == 'win32':
|
if platform == 'win32':
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
from unittest2 import TestCase
|
try:
|
||||||
|
from unittest2 import TestCase
|
||||||
|
except ImportError, e:
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
from pelican.contents import Page
|
from pelican.contents import Page
|
||||||
from pelican.settings import _DEFAULT_CONFIG
|
from pelican.settings import _DEFAULT_CONFIG
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
import unittest2
|
try:
|
||||||
|
import unittest2
|
||||||
|
except ImportError, e:
|
||||||
|
import unittest as unittest2
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import datetime
|
import datetime
|
||||||
from pelican import readers
|
from pelican import readers
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
import unittest2
|
try:
|
||||||
|
import unittest2
|
||||||
|
except ImportError, e:
|
||||||
|
import unittest as unittest2
|
||||||
|
|
||||||
from os.path import dirname, abspath, join
|
from os.path import dirname, abspath, join
|
||||||
|
|
||||||
from pelican.settings import read_settings, _DEFAULT_CONFIG
|
from pelican.settings import read_settings, _DEFAULT_CONFIG
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue