Last active
April 26, 2018 10:55
-
-
Save andreif/948e1ce75905f66937052b9bfdf973ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test_admin(self): | |
| for m, ma in admin.site._registry.items(): | |
| pfx = 'admin:%s_%s_' % (m._meta.app_label, m._meta.model_name) | |
| self.client.get(reverse(pfx + 'changelist')) | |
| if ma.has_add_permission(request=mock.Mock(user=self.user)): | |
| self.client.get(reverse(pfx + 'add')) | |
| for pk in m.objects.values_list('id', flat=True): | |
| self.client.get(reverse(pfx + 'change', args=(pk,))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment