diff options
author | Hasan <hasan.r67@gmail.com> | 2015-11-06 09:51:29 +0330 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-11-12 09:54:43 -0500 |
commit | 8c553e7d3fd3f598a445f3c35711829e9b3645a4 (patch) | |
tree | 9b75a33b19b737d8eeae24155c4923159d99aac2 /tests/admin_registration | |
parent | c550beb0ccc8855fde7ff50ada530f7ceff1a595 (diff) | |
download | django-8c553e7d3fd3f598a445f3c35711829e9b3645a4.tar.gz |
Fixed #25688 -- Made admin.register() disallow an empty list of models.
Diffstat (limited to 'tests/admin_registration')
-rw-r--r-- | tests/admin_registration/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/admin_registration/tests.py b/tests/admin_registration/tests.py index 7471c521d6..202fed86e3 100644 --- a/tests/admin_registration/tests.py +++ b/tests/admin_registration/tests.py @@ -133,3 +133,7 @@ class TestRegistrationDecorator(SimpleTestCase): def test_custom_site_not_an_admin_site(self): self.assertRaisesMessage(ValueError, 'site must subclass AdminSite', register(Person, site=Traveler), NameAdmin) + + def test_empty_models_list_registration_fails(self): + with self.assertRaisesMessage(ValueError, 'At least one model must be passed to register.'): + register()(NameAdmin) |