mirror of
https://github.com/django/django.git
synced 2025-07-23 05:05:17 +00:00
Used "is" for comparisons with None.
This commit is contained in:
parent
ff9e8eccf8
commit
cec11a3336
8 changed files with 17 additions and 16 deletions
|
@ -33,7 +33,7 @@ class ModelTest(TestCase):
|
|||
a.save()
|
||||
|
||||
# Now it has an ID.
|
||||
self.assertTrue(a.id != None)
|
||||
self.assertTrue(a.id is not None)
|
||||
|
||||
# Models have a pk property that is an alias for the primary key
|
||||
# attribute (by default, the 'id' attribute).
|
||||
|
@ -585,7 +585,7 @@ class ModelTest(TestCase):
|
|||
f3 = Field()
|
||||
self.assertTrue(f2 < f1)
|
||||
self.assertTrue(f3 > f1)
|
||||
self.assertFalse(f1 == None)
|
||||
self.assertFalse(f1 is None)
|
||||
self.assertFalse(f2 in (None, 1, ''))
|
||||
|
||||
def test_extra_method_select_argument_with_dashes_and_values(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue