Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SQLite test fix -- refs #9057

  • Loading branch information...
commit 453915bb1272c9a9189a741e6a9b9246edfcbd03 1 parent ddae74b
@timgraham timgraham authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 django/contrib/auth/tests/test_management.py
View
11 django/contrib/auth/tests/test_management.py
@@ -239,21 +239,22 @@ def test_duplicated_permissions(self):
create_permissions(models, [], verbosity=0)
def test_default_permissions(self):
+ permission_content_type = ContentType.objects.get_by_natural_key('auth', 'permission')
models.Permission._meta.permissions = [
('my_custom_permission', 'Some permission'),
]
create_permissions(models, [], verbosity=0)
# add/change/delete permission by default + custom permission
- self.assertEqual(models.Permission.objects.filter(content_type=
- ContentType.objects.get_by_natural_key('auth', 'permission')
+ self.assertEqual(models.Permission.objects.filter(
+ content_type=permission_content_type,
).count(), 4)
- models.Permission.objects.all().delete()
+ models.Permission.objects.filter(content_type=permission_content_type).delete()
models.Permission._meta.default_permissions = []
create_permissions(models, [], verbosity=0)
# custom permission only since default permissions is empty
- self.assertEqual(models.Permission.objects.filter(content_type=
- ContentType.objects.get_by_natural_key('auth', 'permission')
+ self.assertEqual(models.Permission.objects.filter(
+ content_type=permission_content_type,
).count(), 1)
Please sign in to comment.
Something went wrong with that request. Please try again.