diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
index e792597..b516507 100644
a
|
b
|
def create_permissions(app, created_models, verbosity, **kwargs):
|
31 | 31 | searched_perms = list() |
32 | 32 | # The codenames and ctypes that should exist. |
33 | 33 | ctypes = set() |
34 | | ctypes_for_models = ContentType.objects.get_for_models(*app_models) |
35 | | for klass, ctype in ctypes_for_models.iteritems(): |
| 34 | for klass in app_models: |
| 35 | ctype = ContentType.objects.get_for_model(klass) |
36 | 36 | ctypes.add(ctype) |
37 | 37 | for perm in _get_all_permissions(klass._meta): |
38 | 38 | searched_perms.append((ctype, perm)) |
diff --git a/tests/modeltests/proxy_models/models.py b/tests/modeltests/proxy_models/models.py
index c033117..49fd87d 100644
a
|
b
|
class MyPerson(Person):
|
44 | 44 | class Meta: |
45 | 45 | proxy = True |
46 | 46 | ordering = ["name"] |
| 47 | permissions = ( |
| 48 | ("display_users", "May display users information"), |
| 49 | ) |
47 | 50 | |
48 | 51 | objects = SubManager() |
49 | 52 | other = PersonManager() |
… |
… |
class Improvement(Issue):
|
158 | 161 | |
159 | 162 | class ProxyImprovement(Improvement): |
160 | 163 | class Meta: |
161 | | proxy = True |
162 | | No newline at end of file |
| 164 | proxy = True |
diff --git a/tests/modeltests/proxy_models/tests.py b/tests/modeltests/proxy_models/tests.py
index b332103..738e0db 100644
a
|
b
|
class ProxyModelTests(TestCase):
|
167 | 167 | resp = [p.name for p in OtherPerson._default_manager.all()] |
168 | 168 | self.assertEqual(resp, ['barney', 'wilma']) |
169 | 169 | |
| 170 | def test_permissions_created(self): |
| 171 | from django.contrib.auth.models import Permission |
| 172 | try: |
| 173 | Permission.objects.get(name="May display users information") |
| 174 | except Permission.DoesNotExist: |
| 175 | self.fail("The permission 'May display users information' has not been created") |
| 176 | |
170 | 177 | def test_proxy_model_signals(self): |
171 | 178 | """ |
172 | 179 | Test save signals for proxy models |