py2.6 compat
This commit is contained in:
parent
123a25ddb8
commit
8b69e90e55
1 changed files with 3 additions and 1 deletions
|
@ -111,7 +111,9 @@ class BaseTest(TestCase):
|
|||
file=file_obj)
|
||||
|
||||
def _get_category(self, data, category=None, lang='en'):
|
||||
data = {k: (v() if hasattr(v, '__call__') else v) for k, v in data.items()}
|
||||
for k, v in data.items():
|
||||
if hasattr(v, '__call__'):
|
||||
data[k] = v()
|
||||
if not category:
|
||||
category = BlogCategory.objects.create(**data)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue