| 1 | import unittest |
| 2 | from django.core.urlresolvers import Resolver404, resolve |
| 3 | |
| 4 | class EmptyRegexTestCase(unittest.TestCase): |
| 5 | def testBasic(self): |
| 6 | """ |
| 7 | Verifies that we raise a Resolver404 if what we are resolving is |
| 8 | not a regular expression. self.regex.search(path) returns None if |
| 9 | path is not a regular expression. We must never return None from |
| 10 | resolve, or we will get a TypeError further down the line. |
| 11 | |
| 12 | In response to ticket #10834. |
| 13 | """ |
| 14 | non_regex = ["", "a", "\\", "."] |
| 15 | for test in non_regex: |
| 16 | self.assertRaises(Resolver404, resolve, test) |
| 17 | No newline at end of file |