diff --git a/tests/modeltests/field_subclassing/tests.py b/tests/modeltests/field_subclassing/tests.py index 731ab51d24..98da9a3e0f 100644 --- a/tests/modeltests/field_subclassing/tests.py +++ b/tests/modeltests/field_subclassing/tests.py @@ -6,16 +6,16 @@ from models import DataModel class CustomField(TestCase): def test_defer(self): d = DataModel.objects.create(data=[1, 2, 3]) - - self.assertTrue(isinstance(d.data, list)) - + + self.failUnless(isinstance(d.data, list)) + d = DataModel.objects.get(pk=d.pk) - self.assertTrue(isinstance(d.data, list)) + self.failUnless(isinstance(d.data, list)) self.assertEqual(d.data, [1, 2, 3]) - + d = DataModel.objects.defer("data").get(pk=d.pk) d.save() - + d = DataModel.objects.get(pk=d.pk) - self.assertTrue(isinstance(d.data, list)) + self.failUnless(isinstance(d.data, list)) self.assertEqual(d.data, [1, 2, 3]) diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py index 7021c99985..e5a335bfd1 100644 --- a/tests/regressiontests/mail/tests.py +++ b/tests/regressiontests/mail/tests.py @@ -112,8 +112,8 @@ BadHeaderError: Header values can't contain newlines (got u'Subject\nInjection T >>> email.encoding = 'iso-8859-1' >>> email.message()['To'] '=?iso-8859-1?q?S=FCrname=2C_Firstname?= , other@example.com' ->>> email.message()['Subject'].encode() -u'=?iso-8859-1?q?Message_from_Firstname_S=FCrname?=' +>>> email.message()['Subject'].encode() == u'=?iso-8859-1?q?Message_from_Firstname_S=FCrname?=' +True # Make sure headers can be set with a different encoding than utf-8 in SafeMIMEMultipart as well >>> headers = {"Date": "Fri, 09 Nov 2001 01:08:47 -0000", "Message-ID": "foo"} @@ -125,8 +125,8 @@ u'=?iso-8859-1?q?Message_from_Firstname_S=FCrname?=' >>> msg.encoding = 'iso-8859-1' >>> msg.message()['To'] '=?iso-8859-1?q?S=FCrname=2C_Firstname?= ' ->>> msg.message()['Subject'].encode() -u'=?iso-8859-1?q?Message_from_Firstname_S=FCrname?=' +>>> msg.message()['Subject'].encode() == u'=?iso-8859-1?q?Message_from_Firstname_S=FCrname?=' +True # Regression for #12791 - Encode body correctly with other encodings than utf-8 >>> email = EmailMessage('Subject', 'Firstname Sürname is a great guy.', 'from@example.com', ['other@example.com']) diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py index 53659db8ca..1f5179d1db 100644 --- a/tests/regressiontests/model_fields/tests.py +++ b/tests/regressiontests/model_fields/tests.py @@ -35,10 +35,10 @@ class BasicFieldTests(django.test.TestCase): choices = [(0, 0), (1, 1)] model_field = models.Field(choices=choices) form_field = model_field.formfield(show_hidden_initial=True) - self.assertTrue(form_field.show_hidden_initial) + self.failUnless(form_field.show_hidden_initial) form_field = model_field.formfield(show_hidden_initial=False) - self.assertFalse(form_field.show_hidden_initial) + self.failIf(form_field.show_hidden_initial) class DecimalFieldTests(django.test.TestCase): def test_to_python(self): @@ -168,7 +168,7 @@ class TypeCoercionTests(django.test.TestCase): """ def test_lookup_integer_in_charfield(self): self.assertEquals(Post.objects.filter(title=9).count(), 0) - + def test_lookup_integer_in_textfield(self): self.assertEquals(Post.objects.filter(body=24).count(), 0) - +