Ticket #23620: 23620.diff

File 23620.diff, 2.9 KB (added by Tim Graham, 10 years ago)
  • django/contrib/messages/tests/test_cookie.py

    diff --git a/django/contrib/messages/tests/test_cookie.py b/django/contrib/messages/tests/test_cookie.py
    index 1008263..ba7b4dc 100644
    a b class CookieTest(BaseTests, TestCase):  
    6565        response = self.get_response()
    6666        storage.add(constants.INFO, 'test')
    6767        storage.update(response)
    68         self.assertTrue('test' in response.cookies['messages'].value)
     68        self.assertIn('test', response.cookies['messages'].value)
    6969        self.assertEqual(response.cookies['messages']['domain'], '.example.com')
    7070        self.assertEqual(response.cookies['messages']['expires'], '')
    7171        self.assertEqual(response.cookies['messages']['secure'], True)
    class CookieTest(BaseTests, TestCase):  
    114114        self.assertEqual(cookie_storing, 4)
    115115
    116116        self.assertEqual(len(unstored_messages), 1)
    117         self.assertTrue(unstored_messages[0].message == '0' * msg_size)
     117        self.assertEqual(unstored_messages[0].message, '0' * msg_size)
    118118
    119119    def test_json_encoder_decoder(self):
    120120        """
  • tests/foreign_object/tests.py

    diff --git a/tests/foreign_object/tests.py b/tests/foreign_object/tests.py
    index f361c5c..fd34a05 100644
    a b class MultiColumnFKTests(TestCase):  
    319319        with self.assertNumQueries(1):
    320320            fetched = Article.objects.select_related('active_translation').get(
    321321                active_translation__title='Otsikko')
    322             self.assertTrue(fetched.active_translation.title == 'Otsikko')
     322            self.assertEqual(fetched.active_translation.title, 'Otsikko')
    323323        a2 = Article.objects.create(pub_date=datetime.date.today())
    324324        at2_fi = ArticleTranslation(article=a2, lang='fi', title='Atsikko', body='Diipadaapa',
    325325                                    abstract='dipad')
  • tests/null_fk_ordering/tests.py

    diff --git a/tests/null_fk_ordering/tests.py b/tests/null_fk_ordering/tests.py
    index ebbd089..882c4c1 100644
    a b class NullFkOrderingTests(TestCase):  
    2222        # We can't compare results directly (since different databases sort NULLs to
    2323        # different ends of the ordering), but we can check that all results are
    2424        # returned.
    25         self.assertTrue(len(list(Article.objects.all())) == 3)
     25        self.assertEqual(len(Article.objects.all()), 3)
    2626
    2727        s = SystemInfo.objects.create(system_name='System Info')
    2828        f = Forum.objects.create(system_info=s, forum_name='First forum')
    class NullFkOrderingTests(TestCase):  
    3939        # everything else, some sort them afterwards. So we extract the ordered list
    4040        # and check the length. Before the fix, this list was too short (some values
    4141        # were omitted).
    42         self.assertTrue(len(list(Comment.objects.all())) == 4)
     42        self.assertEqual(len(Comment.objects.all()), 4)
Back to Top