diff --git a/tests/delete/tests.py b/tests/delete/tests.py index 5330b4a13b3..dd3c4278242 100644 --- a/tests/delete/tests.py +++ b/tests/delete/tests.py @@ -37,7 +37,7 @@ class OnDeleteTests(TestCase): a = create_a('setnull') a.setnull.delete() a = A.objects.get(pk=a.pk) - self.assertEqual(None, a.setnull) + self.assertIsNone(a.setnull) def test_setdefault(self): a = create_a('setdefault') @@ -49,7 +49,7 @@ class OnDeleteTests(TestCase): a = create_a('setdefault_none') a.setdefault_none.delete() a = A.objects.get(pk=a.pk) - self.assertEqual(None, a.setdefault_none) + self.assertIsNone(a.setdefault_none) def test_cascade(self): a = create_a('cascade') @@ -119,7 +119,7 @@ class OnDeleteTests(TestCase): self.assertFalse(R.objects.filter(pk=a.child_setnull_id).exists()) a = A.objects.get(pk=a.pk) - self.assertEqual(None, a.child_setnull) + self.assertIsNone(a.child_setnull) def test_setnull_from_parent(self): a = create_a('child_setnull') @@ -127,13 +127,13 @@ class OnDeleteTests(TestCase): self.assertFalse(RChild.objects.filter(pk=a.child_setnull_id).exists()) a = A.objects.get(pk=a.pk) - self.assertEqual(None, a.child_setnull) + self.assertIsNone(a.child_setnull) def test_o2o_setnull(self): a = create_a('o2o_setnull') a.o2o_setnull.delete() a = A.objects.get(pk=a.pk) - self.assertEqual(None, a.o2o_setnull) + self.assertIsNone(a.o2o_setnull) class DeletionTests(TestCase): @@ -197,11 +197,11 @@ class DeletionTests(TestCase): a.cascade.delete() for obj in deleted: - self.assertEqual(None, obj.pk) + self.assertIsNone(obj.pk) for pk_list in related_setnull_sets: for a in A.objects.filter(id__in=pk_list): - self.assertEqual(None, a.setnull) + self.assertIsNone(a.setnull) models.signals.pre_delete.disconnect(pre_delete) diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py index 19cf0fd9d05..aa26579a5be 100644 --- a/tests/forms_tests/tests/test_fields.py +++ b/tests/forms_tests/tests/test_fields.py @@ -186,9 +186,9 @@ class FieldsTests(SimpleTestCase): def test_integerfield_2(self): f = IntegerField(required=False) - self.assertEqual(None, f.clean('')) + self.assertIsNone(f.clean('')) self.assertEqual('None', repr(f.clean(''))) - self.assertEqual(None, f.clean(None)) + self.assertIsNone(f.clean(None)) self.assertEqual('None', repr(f.clean(None))) self.assertEqual(1, f.clean('1')) self.assertIsInstance(f.clean('1'), int) @@ -301,8 +301,8 @@ class FieldsTests(SimpleTestCase): def test_floatfield_2(self): f = FloatField(required=False) - self.assertEqual(None, f.clean('')) - self.assertEqual(None, f.clean(None)) + self.assertIsNone(f.clean('')) + self.assertIsNone(f.clean(None)) self.assertEqual(1.0, f.clean('1')) self.assertEqual(f.max_value, None) self.assertEqual(f.min_value, None) @@ -379,8 +379,8 @@ class FieldsTests(SimpleTestCase): def test_decimalfield_2(self): f = DecimalField(max_digits=4, decimal_places=2, required=False) - self.assertEqual(None, f.clean('')) - self.assertEqual(None, f.clean(None)) + self.assertIsNone(f.clean('')) + self.assertIsNone(f.clean(None)) self.assertEqual(f.clean('1'), Decimal("1")) self.assertEqual(f.max_digits, 4) self.assertEqual(f.decimal_places, 2) @@ -483,9 +483,9 @@ class FieldsTests(SimpleTestCase): def test_datefield_2(self): f = DateField(required=False) - self.assertEqual(None, f.clean(None)) + self.assertIsNone(f.clean(None)) self.assertEqual('None', repr(f.clean(None))) - self.assertEqual(None, f.clean('')) + self.assertIsNone(f.clean('')) self.assertEqual('None', repr(f.clean(''))) def test_datefield_3(self): @@ -604,9 +604,9 @@ class FieldsTests(SimpleTestCase): def test_datetimefield_3(self): f = DateTimeField(required=False) - self.assertEqual(None, f.clean(None)) + self.assertIsNone(f.clean(None)) self.assertEqual('None', repr(f.clean(None))) - self.assertEqual(None, f.clean('')) + self.assertIsNone(f.clean('')) self.assertEqual('None', repr(f.clean(''))) def test_datetimefield_4(self): @@ -1075,7 +1075,7 @@ class FieldsTests(SimpleTestCase): def test_typedchoicefield_6(self): f = TypedChoiceField(choices=[(1, "+1"), (-1, "-1")], coerce=int, required=False, empty_value=None) - self.assertEqual(None, f.clean('')) + self.assertIsNone(f.clean('')) def test_typedchoicefield_has_changed(self): # has_changed should not trigger required validation @@ -1104,15 +1104,15 @@ class FieldsTests(SimpleTestCase): def test_nullbooleanfield_1(self): f = NullBooleanField() - self.assertEqual(None, f.clean('')) + self.assertIsNone(f.clean('')) self.assertEqual(True, f.clean(True)) self.assertEqual(False, f.clean(False)) - self.assertEqual(None, f.clean(None)) + self.assertIsNone(f.clean(None)) self.assertEqual(False, f.clean('0')) self.assertEqual(True, f.clean('1')) - self.assertEqual(None, f.clean('2')) - self.assertEqual(None, f.clean('3')) - self.assertEqual(None, f.clean('hello')) + self.assertIsNone(f.clean('2')) + self.assertIsNone(f.clean('3')) + self.assertIsNone(f.clean('hello')) self.assertEqual(True, f.clean('true')) self.assertEqual(False, f.clean('false')) @@ -1129,7 +1129,7 @@ class FieldsTests(SimpleTestCase): hidden_nullbool1 = NullBooleanField(widget=HiddenInput, initial=True) hidden_nullbool2 = NullBooleanField(widget=HiddenInput, initial=False) f = HiddenNullBooleanForm({'hidden_nullbool1': 'True', 'hidden_nullbool2': 'False'}) - self.assertEqual(None, f.full_clean()) + self.assertIsNone(f.full_clean()) self.assertEqual(True, f.cleaned_data['hidden_nullbool1']) self.assertEqual(False, f.cleaned_data['hidden_nullbool2']) @@ -1143,10 +1143,10 @@ class FieldsTests(SimpleTestCase): nullbool1 = NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES)) nullbool2 = NullBooleanField(widget=RadioSelect(choices=NULLBOOL_CHOICES)) f = MySQLNullBooleanForm({'nullbool0': '1', 'nullbool1': '0', 'nullbool2': ''}) - self.assertEqual(None, f.full_clean()) + self.assertIsNone(f.full_clean()) self.assertEqual(True, f.cleaned_data['nullbool0']) self.assertEqual(False, f.cleaned_data['nullbool1']) - self.assertEqual(None, f.cleaned_data['nullbool2']) + self.assertIsNone(f.cleaned_data['nullbool2']) def test_nullbooleanfield_changed(self): f = NullBooleanField() @@ -1249,7 +1249,7 @@ class FieldsTests(SimpleTestCase): def test_typedmultiplechoicefield_7(self): # If you want cleaning an empty value to return a different type, tell the field f = TypedMultipleChoiceField(choices=[(1, "+1"), (-1, "-1")], coerce=int, required=False, empty_value=None) - self.assertEqual(None, f.clean([])) + self.assertIsNone(f.clean([])) def test_typedmultiplechoicefield_has_changed(self): # has_changed should not trigger required validation @@ -1402,10 +1402,10 @@ class FieldsTests(SimpleTestCase): f = SplitDateTimeField(required=False) self.assertEqual(datetime.datetime(2006, 1, 10, 7, 30), f.clean([datetime.date(2006, 1, 10), datetime.time(7, 30)])) self.assertEqual(datetime.datetime(2006, 1, 10, 7, 30), f.clean(['2006-01-10', '07:30'])) - self.assertEqual(None, f.clean(None)) - self.assertEqual(None, f.clean('')) - self.assertEqual(None, f.clean([''])) - self.assertEqual(None, f.clean(['', ''])) + self.assertIsNone(f.clean(None)) + self.assertIsNone(f.clean('')) + self.assertIsNone(f.clean([''])) + self.assertIsNone(f.clean(['', ''])) self.assertRaisesMessage(ValidationError, "'Enter a list of values.'", f.clean, 'hello') six.assertRaisesRegex(self, ValidationError, "'Enter a valid date\.', u?'Enter a valid time\.'", f.clean, ['hello', 'there']) self.assertRaisesMessage(ValidationError, "'Enter a valid time.'", f.clean, ['2006-01-10', 'there']) diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index 0973d31a192..6aedfa85078 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -2104,9 +2104,9 @@ class FormsTestCase(TestCase): # Empty values for fields will NOT raise a `required` error on an # optional `MultiValueField` f = PhoneField(required=False) - self.assertEqual(None, f.clean('')) - self.assertEqual(None, f.clean(None)) - self.assertEqual(None, f.clean([])) + self.assertIsNone(f.clean('')) + self.assertIsNone(f.clean(None)) + self.assertIsNone(f.clean([])) self.assertEqual('+61. ext. (label: )', f.clean(['+61'])) self.assertEqual('+61.287654321 ext. 123 (label: )', f.clean(['+61', '287654321', '123'])) self.assertEqual('+61.287654321 ext. 123 (label: Home)', f.clean(['+61', '287654321', '123', 'Home'])) @@ -2131,9 +2131,9 @@ class FormsTestCase(TestCase): # For an optional `MultiValueField` with `require_all_fields=False`, we # don't get any `required` error but we still get `incomplete` errors. f = PhoneField(required=False, require_all_fields=False) - self.assertEqual(None, f.clean('')) - self.assertEqual(None, f.clean(None)) - self.assertEqual(None, f.clean([])) + self.assertIsNone(f.clean('')) + self.assertIsNone(f.clean(None)) + self.assertIsNone(f.clean([])) self.assertRaisesMessage(ValidationError, "'Enter a complete value.'", f.clean, ['+61']) self.assertEqual('+61.287654321 ext. 123 (label: )', f.clean(['+61', '287654321', '123'])) six.assertRaisesRegex(self, ValidationError, diff --git a/tests/forms_tests/tests/tests.py b/tests/forms_tests/tests/tests.py index 8e8aa82cdd6..6dafee1fb87 100644 --- a/tests/forms_tests/tests/tests.py +++ b/tests/forms_tests/tests/tests.py @@ -334,7 +334,7 @@ class EmptyLabelTestCase(TestCase): def test_get_display_value_on_none(self): m = ChoiceModel.objects.create(name='test', choice='', choice_integer=None) - self.assertEqual(None, m.choice_integer) + self.assertIsNone(m.choice_integer) self.assertEqual('No Preference', m.get_choice_integer_display()) def test_html_rendering_of_prepopulated_models(self): diff --git a/tests/generic_views/test_edit.py b/tests/generic_views/test_edit.py index 64e1759a269..3950adb57fe 100644 --- a/tests/generic_views/test_edit.py +++ b/tests/generic_views/test_edit.py @@ -35,7 +35,7 @@ class FormMixinTests(TestCase): request = get_request default_kwargs = TestFormMixin().get_form_kwargs() - self.assertEqual(None, default_kwargs.get('prefix')) + self.assertIsNone(default_kwargs.get('prefix')) set_mixin = TestFormMixin() set_mixin.prefix = test_string diff --git a/tests/gis_tests/gdal_tests/test_ds.py b/tests/gis_tests/gdal_tests/test_ds.py index c9cb17fc9cf..0de4c282b9a 100644 --- a/tests/gis_tests/gdal_tests/test_ds.py +++ b/tests/gis_tests/gdal_tests/test_ds.py @@ -118,7 +118,7 @@ class DataSourceTest(unittest.TestCase): # Now checking the field names. flds = layer.fields for f in flds: - self.assertEqual(True, f in source.fields) + self.assertIn(f, source.fields) # Negative FIDs are not allowed. self.assertRaises(OGRIndexError, layer.__getitem__, -1) @@ -199,7 +199,7 @@ class DataSourceTest(unittest.TestCase): # Testing Feature.__iter__ for fld in feat: - self.assertEqual(True, fld.name in source.fields.keys()) + self.assertIn(fld.name, source.fields.keys()) def test05_geometries(self): "Testing Geometries from Data Source Features." @@ -229,7 +229,7 @@ class DataSourceTest(unittest.TestCase): lyr = ds[0] # When not set, it should be None. - self.assertEqual(None, lyr.spatial_filter) + self.assertIsNone(lyr.spatial_filter) # Must be set a/an OGRGeometry or 4-tuple. self.assertRaises(TypeError, lyr._set_spatial_filter, 'foo') diff --git a/tests/gis_tests/gdal_tests/test_srs.py b/tests/gis_tests/gdal_tests/test_srs.py index 1d011d88ab4..98e43127862 100644 --- a/tests/gis_tests/gdal_tests/test_srs.py +++ b/tests/gis_tests/gdal_tests/test_srs.py @@ -255,4 +255,4 @@ class SpatialRefTest(unittest.TestCase): self.assertEqual('WGS_1984', s1['DATUM']) self.assertEqual('EPSG', s1['AUTHORITY']) self.assertEqual(4326, int(s1['AUTHORITY', 1])) - self.assertEqual(None, s1['FOOBAR']) + self.assertIsNone(s1['FOOBAR']) diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index c14a2782dc8..b0843c9bd20 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -227,8 +227,8 @@ class GEOSTest(unittest.TestCase, TestDataMixin): self.assertEqual(pnt.geom_typeid, 0) self.assertEqual(p.x, pnt.x) self.assertEqual(p.y, pnt.y) - self.assertEqual(True, pnt == fromstr(p.wkt)) - self.assertEqual(False, pnt == prev) + self.assertEqual(pnt, fromstr(p.wkt)) + self.assertEqual(False, pnt == prev) # Use assertEqual to test __eq__ # Making sure that the point's X, Y components are what we expect self.assertAlmostEqual(p.x, pnt.tuple[0], 9) @@ -244,7 +244,7 @@ class GEOSTest(unittest.TestCase, TestDataMixin): set_tup2 = (5.23, 2.71, 3.14) else: self.assertEqual(False, pnt.hasz) - self.assertEqual(None, pnt.z) + self.assertIsNone(pnt.z) tup_args = (p.x, p.y) set_tup1 = (2.71, 3.14) set_tup2 = (3.14, 2.71) @@ -255,8 +255,8 @@ class GEOSTest(unittest.TestCase, TestDataMixin): # Now testing the different constructors pnt2 = Point(tup_args) # e.g., Point((1, 2)) pnt3 = Point(*tup_args) # e.g., Point(1, 2) - self.assertEqual(True, pnt == pnt2) - self.assertEqual(True, pnt == pnt3) + self.assertEqual(pnt, pnt2) + self.assertEqual(pnt, pnt3) # Now testing setting the x and y pnt.y = 3.14 @@ -305,8 +305,8 @@ class GEOSTest(unittest.TestCase, TestDataMixin): if hasattr(l, 'tup'): self.assertEqual(l.tup, ls.tuple) - self.assertEqual(True, ls == fromstr(l.wkt)) - self.assertEqual(False, ls == prev) + self.assertEqual(ls, fromstr(l.wkt)) + self.assertEqual(False, ls == prev) # Use assertEqual to test __eq__ self.assertRaises(GEOSIndexError, ls.__getitem__, len(ls)) prev = ls @@ -330,8 +330,8 @@ class GEOSTest(unittest.TestCase, TestDataMixin): self.assertAlmostEqual(l.centroid[0], ml.centroid.x, 9) self.assertAlmostEqual(l.centroid[1], ml.centroid.y, 9) - self.assertEqual(True, ml == fromstr(l.wkt)) - self.assertEqual(False, ml == prev) + self.assertEqual(ml, fromstr(l.wkt)) + self.assertEqual(False, ml == prev) # Use assertEqual to test __eq__ prev = ml for ls in ml: @@ -394,9 +394,10 @@ class GEOSTest(unittest.TestCase, TestDataMixin): self.assertAlmostEqual(p.centroid[1], poly.centroid.tuple[1], 9) # Testing the geometry equivalence - self.assertEqual(True, poly == fromstr(p.wkt)) - self.assertEqual(False, poly == prev) # Should not be equal to previous geometry - self.assertEqual(True, poly != prev) + self.assertEqual(poly, fromstr(p.wkt)) + # Should not be equal to previous geometry + self.assertEqual(False, poly == prev) # Use assertEqual to test __eq__ + self.assertNotEqual(poly, prev) # Use assertNotEqual to test __ne__ # Testing the exterior ring ring = poly.exterior_ring diff --git a/tests/gis_tests/relatedapp/tests.py b/tests/gis_tests/relatedapp/tests.py index 5422dd48a73..97c42b5dc3f 100644 --- a/tests/gis_tests/relatedapp/tests.py +++ b/tests/gis_tests/relatedapp/tests.py @@ -288,7 +288,7 @@ class RelatedGeoModelTest(TestCase): Book.objects.create(title='Without Author') b = Book.objects.select_related('author').get(title='Without Author') # Should be `None`, and not a 'dummy' model. - self.assertEqual(None, b.author) + self.assertIsNone(b.author) @skipUnlessDBFeature("supports_collect_aggr") @ignore_warnings(category=RemovedInDjango20Warning) diff --git a/tests/gis_tests/test_geoip.py b/tests/gis_tests/test_geoip.py index 57647314b35..d456dca1bf4 100644 --- a/tests/gis_tests/test_geoip.py +++ b/tests/gis_tests/test_geoip.py @@ -32,16 +32,16 @@ class GeoIPTest(unittest.TestCase): g3 = GeoIP.open(path, 0) # MaxMind Python API syntax. for g in (g1, g2, g3): - self.assertEqual(True, bool(g._country)) - self.assertEqual(True, bool(g._city)) + self.assertTrue(g._country) + self.assertTrue(g._city) # Only passing in the location of one database. city = os.path.join(path, 'GeoLiteCity.dat') cntry = os.path.join(path, 'GeoIP.dat') g4 = GeoIP(city, country='') - self.assertEqual(None, g4._country) + self.assertIsNone(g4._country) g5 = GeoIP(cntry, city='') - self.assertEqual(None, g5._city) + self.assertIsNone(g5._city) # Improper parameters. bad_params = (23, 'foo', 15.23) diff --git a/tests/gis_tests/test_spatialrefsys.py b/tests/gis_tests/test_spatialrefsys.py index 66e30f3de1c..e0c593ff4a1 100644 --- a/tests/gis_tests/test_spatialrefsys.py +++ b/tests/gis_tests/test_spatialrefsys.py @@ -56,7 +56,7 @@ class SpatialRefSysTest(unittest.TestCase): # the testing with the 'startswith' flag. auth_name, oracle_flag = sd['auth_name'] if postgis or (oracle and oracle_flag): - self.assertEqual(True, srs.auth_name.startswith(auth_name)) + self.assertTrue(srs.auth_name.startswith(auth_name)) self.assertEqual(sd['auth_srid'], srs.auth_srid) @@ -71,14 +71,14 @@ class SpatialRefSysTest(unittest.TestCase): """ for sd in test_srs: sr = SpatialRefSys.objects.get(srid=sd['srid']) - self.assertEqual(True, sr.spheroid.startswith(sd['spheroid'])) + self.assertTrue(sr.spheroid.startswith(sd['spheroid'])) self.assertEqual(sd['geographic'], sr.geographic) self.assertEqual(sd['projected'], sr.projected) if not (spatialite and not sd['spatialite']): # Can't get 'NAD83 / Texas South Central' from PROJ.4 string # on SpatiaLite - self.assertEqual(True, sr.name.startswith(sd['name'])) + self.assertTrue(sr.name.startswith(sd['name'])) # Testing the SpatialReference object directly. if postgis or spatialite: diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index d3daf6e1830..0be38f27b8b 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -131,13 +131,13 @@ class TranslationTests(TestCase): # It should be possible to compare *_lazy objects. s1 = ugettext_lazy('Add %(name)s') - self.assertEqual(True, s == s1) + self.assertEqual(s, s1) s2 = gettext_lazy('Add %(name)s') s3 = gettext_lazy('Add %(name)s') - self.assertEqual(True, s2 == s3) - self.assertEqual(True, s == s2) + self.assertEqual(s2, s3) + self.assertEqual(s, s2) s4 = ugettext_lazy('Some other string') - self.assertEqual(False, s == s4) + self.assertNotEqual(s, s4) @skipUnless(six.PY2, "No more bytestring translations on PY3") def test_lazy_and_bytestrings(self): @@ -540,7 +540,7 @@ class FormattingTests(TestCase): 'time_field': '20:50', 'integer_field': '1.234', }) - self.assertEqual(False, form.is_valid()) + self.assertFalse(form.is_valid()) self.assertEqual(['Introdu\xefu un n\xfamero.'], form.errors['float_field']) self.assertEqual(['Introdu\xefu un n\xfamero.'], form.errors['decimal_field']) self.assertEqual(['Introdu\xefu una data v\xe0lida.'], form.errors['date_field']) @@ -552,7 +552,7 @@ class FormattingTests(TestCase): 'date_field_day': '31', 'date_field_year': '2009' }) - self.assertEqual(True, form2.is_valid()) + self.assertTrue(form2.is_valid()) self.assertEqual(datetime.date(2009, 12, 31), form2.cleaned_data['date_field']) self.assertHTMLEqual( '\n\n', @@ -627,7 +627,7 @@ class FormattingTests(TestCase): 'time_field': '20:50', 'integer_field': '1.234', }) - self.assertEqual(True, form3.is_valid()) + self.assertTrue(form3.is_valid()) self.assertEqual(decimal.Decimal('66666.666'), form3.cleaned_data['decimal_field']) self.assertEqual(99999.999, form3.cleaned_data['float_field']) self.assertEqual(datetime.date(2009, 12, 31), form3.cleaned_data['date_field']) @@ -657,7 +657,7 @@ class FormattingTests(TestCase): 'time_field': '20:50', 'integer_field': '1234', }) - self.assertEqual(True, form4.is_valid()) + self.assertTrue(form4.is_valid()) self.assertEqual(decimal.Decimal('66666.666'), form4.cleaned_data['decimal_field']) self.assertEqual(99999.999, form4.cleaned_data['float_field']) self.assertEqual(datetime.date(2009, 12, 31), form4.cleaned_data['date_field']) @@ -670,7 +670,7 @@ class FormattingTests(TestCase): 'date_field_day': '31', 'date_field_year': '2009' }) - self.assertEqual(True, form5.is_valid()) + self.assertTrue(form5.is_valid()) self.assertEqual(datetime.date(2009, 12, 31), form5.cleaned_data['date_field']) self.assertHTMLEqual( '\n\n', @@ -729,7 +729,7 @@ class FormattingTests(TestCase): 'time_field': '20:50', 'integer_field': '1234', }) - self.assertEqual(True, form5.is_valid()) + self.assertTrue(form5.is_valid()) self.assertEqual(decimal.Decimal('66666.666'), form5.cleaned_data['decimal_field']) self.assertEqual(99999.999, form5.cleaned_data['float_field']) self.assertEqual(datetime.date(2009, 12, 31), form5.cleaned_data['date_field']) @@ -742,7 +742,7 @@ class FormattingTests(TestCase): 'date_field_day': '31', 'date_field_year': '2009' }) - self.assertEqual(True, form6.is_valid()) + self.assertTrue(form6.is_valid()) self.assertEqual(datetime.date(2009, 12, 31), form6.cleaned_data['date_field']) self.assertHTMLEqual( '\n\n', @@ -771,7 +771,7 @@ class FormattingTests(TestCase): 'cents_paid': decimal.Decimal('59.47'), 'products_delivered': 12000, }) - self.assertEqual(True, form6.is_valid()) + self.assertTrue(form6.is_valid()) self.assertHTMLEqual( form6.as_ul(), '