mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #26747 -- Used more specific assertions in the Django test suite.
This commit is contained in:
parent
ea34426ae7
commit
4f336f6652
87 changed files with 406 additions and 406 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue