Refactor tests

This commit is contained in:
Iacopo Spalletti 2016-04-08 12:40:46 +02:00
parent e3f89d0ea2
commit 7b040e1b01

View file

@ -646,11 +646,11 @@ class KnockerTest(BaseTest):
self.assertEqual(knock_create['message'], posts[0].title)
self.assertEqual(knock_create['language'], language)
for language in posts[0].get_available_languages():
with smart_override(language):
posts[0].set_current_language(language)
knock_create = posts[0].as_knock(False)
self.assertEqual(knock_create['title'],
'new {0}'.format(posts[0]._meta.verbose_name))
self.assertEqual(knock_create['message'], posts[0].title)
self.assertEqual(knock_create['language'], language)
for language in posts[0].get_available_languages():
with smart_override(language):
posts[0].set_current_language(language)
knock_create = posts[0].as_knock(False)
self.assertEqual(knock_create['title'],
'new {0}'.format(posts[0]._meta.verbose_name))
self.assertEqual(knock_create['message'], posts[0].title)
self.assertEqual(knock_create['language'], language)