mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user