Ticket #17640: patch_17640.diff

File patch_17640.diff, 1.4 KB (added by Zbigniew Siciarz, 13 years ago)

Got rid of DeprecationWarnings.

  • tests/regressiontests/test_utils/tests.py

    diff --git a/tests/regressiontests/test_utils/tests.py b/tests/regressiontests/test_utils/tests.py
    index 72a8154..4661703 100644
    a b class AssertTemplateUsedContextManagerTests(TestCase):  
    140140            with self.assertTemplateUsed('template_used/base.html'):
    141141                pass
    142142        except AssertionError, e:
    143             self.assertTrue('template_used/base.html' in e.message)
     143            self.assertTrue('template_used/base.html' in unicode(e))
    144144
    145145        try:
    146146            with self.assertTemplateUsed(template_name='template_used/base.html'):
    147147                pass
    148148        except AssertionError, e:
    149             self.assertTrue('template_used/base.html' in e.message)
     149            self.assertTrue('template_used/base.html' in unicode(e))
    150150
    151151        try:
    152152            with self.assertTemplateUsed('template_used/base.html'):
    153153                render_to_string('template_used/alternative.html')
    154154        except AssertionError, e:
    155             self.assertTrue('template_used/base.html' in e.message, e.message)
    156             self.assertTrue('template_used/alternative.html' in e.message, e.message)
     155            self.assertTrue('template_used/base.html' in unicode(e), unicode(e))
     156            self.assertTrue('template_used/alternative.html' in unicode(e), unicode(e))
    157157
    158158    def test_failure(self):
    159159        with self.assertRaises(TypeError):
Back to Top