diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-03-22 08:49:48 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-03-22 08:49:48 +0000 |
| commit | e78d6b406bede7c021aaecf7ae2c8c893e0ea84a (patch) | |
| tree | 22bd9b1e2cb95232ecabb847c2019944a3e95ba1 /tests | |
| parent | a8d0fc10015be745c5d274b990d94dfb7d57c9d5 (diff) | |
Reverted parts of r16963 to fix a regression on the creation of permissions on proxy models. Refs #17904. Thanks koenb for the report and claudep for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17776 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/proxy_models/models.py | 5 | ||||
| -rw-r--r-- | tests/modeltests/proxy_models/tests.py | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/modeltests/proxy_models/models.py b/tests/modeltests/proxy_models/models.py index c033117bf8..49fd87deff 100644 --- a/tests/modeltests/proxy_models/models.py +++ b/tests/modeltests/proxy_models/models.py @@ -44,6 +44,9 @@ class MyPerson(Person): class Meta: proxy = True ordering = ["name"] + permissions = ( + ("display_users", "May display users information"), + ) objects = SubManager() other = PersonManager() @@ -158,4 +161,4 @@ class Improvement(Issue): class ProxyImprovement(Improvement): class Meta: - proxy = True
\ No newline at end of file + proxy = True diff --git a/tests/modeltests/proxy_models/tests.py b/tests/modeltests/proxy_models/tests.py index b3321038db..738e0dbce2 100644 --- a/tests/modeltests/proxy_models/tests.py +++ b/tests/modeltests/proxy_models/tests.py @@ -167,6 +167,13 @@ class ProxyModelTests(TestCase): resp = [p.name for p in OtherPerson._default_manager.all()] self.assertEqual(resp, ['barney', 'wilma']) + def test_permissions_created(self): + from django.contrib.auth.models import Permission + try: + Permission.objects.get(name="May display users information") + except Permission.DoesNotExist: + self.fail("The permission 'May display users information' has not been created") + def test_proxy_model_signals(self): """ Test save signals for proxy models |
