Beispiel #1
0
    def test_can_see_module_in_admin(self):
        url = reverse('admin:index')
        response = self.client.get(url)
        assert response.status_code == 200

        # Use django's reverse, since that's what the admin will use. Using our
        # own would fail the assertion because of the locale that gets added.
        self.list_url = django_reverse(
            'admin:addons_addonregionalrestrictions_changelist')
        assert self.list_url in response.content.decode('utf-8')
Beispiel #2
0
    def test_can_see_shelf_module_in_admin_with_discovery_edit(self):
        user = user_factory(email='*****@*****.**')
        self.grant_permission(user, 'Discovery:Edit')
        self.client.login(email=user.email)
        url = reverse('admin:index')
        response = self.client.get(url)
        assert response.status_code == 200

        # Use django's reverse, since that's what the admin will use. Using our
        # own would fail the assertion because of the locale that gets added.
        self.list_url = django_reverse('admin:discovery_homepageshelves_changelist')
        assert self.list_url in response.content.decode('utf-8')