1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

[1.10.x] Fixed #26747 -- Used more specific assertions in the Django test suite.

Backport of 4f336f6652 from master
This commit is contained in:
Jon Dufresne
2016-06-16 11:19:18 -07:00
committed by Tim Graham
parent 70b7d6b4ea
commit 13d60298ea
87 changed files with 404 additions and 404 deletions

View File

@@ -220,7 +220,7 @@ class IsActiveTestCase(TestCase):
def test_builtin_user_isactive(self):
user = User.objects.create(username='foo', email='foo@bar.com')
# is_active is true by default
self.assertEqual(user.is_active, True)
self.assertIs(user.is_active, True)
user.is_active = False
user.save()
user_fetched = User.objects.get(pk=user.pk)
@@ -234,14 +234,14 @@ class IsActiveTestCase(TestCase):
"""
UserModel = get_user_model()
user = UserModel(username='foo')
self.assertEqual(user.is_active, True)
self.assertIs(user.is_active, True)
# you can set the attribute - but it will not save
user.is_active = False
# there should be no problem saving - but the attribute is not saved
user.save()
user_fetched = UserModel._default_manager.get(pk=user.pk)
# the attribute is always true for newly retrieved instance
self.assertEqual(user_fetched.is_active, True)
self.assertIs(user_fetched.is_active, True)
class TestCreateSuperUserSignals(TestCase):