py2.6 compat

This commit is contained in:
Tadas Dailyda 2015-07-20 17:16:52 +03:00
parent 123a25ddb8
commit 8b69e90e55

View file

@ -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: