diff --git a/tests/regressiontests/test_utils/tests.py b/tests/regressiontests/test_utils/tests.py
index 72a8154..c68f07e 100644
a
|
b
|
class AssertTemplateUsedContextManagerTests(TestCase):
|
136 | 136 | pass |
137 | 137 | |
138 | 138 | def test_error_message(self): |
139 | | try: |
| 139 | with self.assertRaisesRegexp(AssertionError, '^template_used/base\.html'): |
140 | 140 | with self.assertTemplateUsed('template_used/base.html'): |
141 | 141 | pass |
142 | | except AssertionError, e: |
143 | | self.assertTrue('template_used/base.html' in e.message) |
144 | 142 | |
145 | | try: |
| 143 | with self.assertRaisesRegexp(AssertionError, '^template_used/base\.html'): |
146 | 144 | with self.assertTemplateUsed(template_name='template_used/base.html'): |
147 | 145 | pass |
148 | | except AssertionError, e: |
149 | | self.assertTrue('template_used/base.html' in e.message) |
150 | 146 | |
151 | | try: |
| 147 | with self.assertRaisesRegexp(AssertionError, |
| 148 | '^template_used/base\.html.*template_used/alternative\.html$'): |
152 | 149 | with self.assertTemplateUsed('template_used/base.html'): |
153 | 150 | render_to_string('template_used/alternative.html') |
154 | | 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) |
157 | 151 | |
158 | 152 | def test_failure(self): |
159 | 153 | with self.assertRaises(TypeError): |