diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-03-08 23:25:37 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-03-08 23:25:37 +0000 |
| commit | 960af90279081e7a4121736f3f2bc67077f11b31 (patch) | |
| tree | b886c53a203dacdd717a30da98e2ca2dc5f04ef4 /tests/regressiontests/templates/smartif.py | |
| parent | 021ba30ad1d4fffada4f2d43d47a4704bcfca45e (diff) | |
Fixed #13058 - "smart if" template tag doesn't support "if not in ..." condition
Thanks to ramusus for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12732 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates/smartif.py')
| -rw-r--r-- | tests/regressiontests/templates/smartif.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/smartif.py b/tests/regressiontests/templates/smartif.py index 0114753830..5e5d7704e7 100644 --- a/tests/regressiontests/templates/smartif.py +++ b/tests/regressiontests/templates/smartif.py @@ -27,6 +27,13 @@ class SmartIfTests(unittest.TestCase): self.assertCalcEqual(False, [1, 'in', None]) self.assertCalcEqual(False, [None, 'in', list_]) + def test_not_in(self): + list_ = [1,2,3] + self.assertCalcEqual(False, [1, 'not', 'in', list_]) + self.assertCalcEqual(True, [4, 'not', 'in', list_]) + self.assertCalcEqual(False, [1, 'not', 'in', None]) + self.assertCalcEqual(True, [None, 'not', 'in', list_]) + def test_precedence(self): # (False and False) or True == True <- we want this one, like Python # False and (False or True) == False |
