diff --git a/example/app/test_msf.py b/example/app/test_msf.py index b5e3932..dc057ee 100644 --- a/example/app/test_msf.py +++ b/example/app/test_msf.py @@ -32,12 +32,8 @@ else: u = str -if VERSION < (1, 9): - def get_field(model, name): - return model._meta.get_field_by_name(name)[0] -else: - def get_field(model, name): - return model._meta.get_field(name) +def get_field(model, name): + return model._meta.get_field(name) class MultiSelectTestCase(TestCase): @@ -77,12 +73,8 @@ class MultiSelectTestCase(TestCase): # call Field.from_db_field, it simply returns a Python representation # of the data in the database (which in our case is a string of # comma-separated values). The bug was fixed in Django 1.8+. - if VERSION >= (1, 6) and VERSION < (1, 8): - self.assertStringEqual(tag_list_list, [u('sex,work,happy')]) - self.assertStringEqual(categories_list_list, [u('1,3,5')]) - else: - self.assertListEqual(tag_list_list, [['sex', 'work', 'happy']]) - self.assertListEqual(categories_list_list, [['1', '3', '5']]) + self.assertListEqual(tag_list_list, [['sex', 'work', 'happy']]) + self.assertListEqual(categories_list_list, [['1', '3', '5']]) def test_form(self): form_class = modelform_factory(Book, fields=('title', 'tags', 'categories')) @@ -139,7 +131,7 @@ class MultiSelectTestCase(TestCase): self.assertEqual(len(form_class.base_fields), 1) form = form_class(initial={'published_in': ['BC', 'AK']}) - expected_html = u("""