Skip to content

Commit

Permalink
WIP bnzk#28
Browse files Browse the repository at this point in the history
  • Loading branch information
benzkji committed Oct 15, 2022
1 parent 1704473 commit 960374e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion painless_redirects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class RedirectAdmin(admin.ModelAdmin):
list_editable = ('enabled', 'ignored', 'new_path', 'permanent')
list_filter = [
'enabled',
'ignored',
'auto_created',
'wildcard_match',
'ignored',
'permanent',
'site',
'new_site',
Expand Down
13 changes: 13 additions & 0 deletions painless_redirects/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@ def test_basic_admin_change_view(self):
url = reverse('admin:painless_redirects_redirect_change', args=(obj.id, ))
response = self.client.get(url, follow=True)
self.assertEqual(response.status_code, 200)

def test_admin_action_ignor(self):
self.client.login(username=self.USER, password=self.PASSWORD)
obj = Redirect.objects.create(
old_path="/the-old-path/",
new_path="/the-new-path/",
)
url = reverse('admin:painless_redirects_redirect_changelist')
response = self.client.get(url, follow=True)
self.assertEqual(response.status_code, 200)
url = reverse('admin:painless_redirects_redirect_change', args=(obj.id, ))
response = self.client.get(url, follow=True)
self.assertEqual(response.status_code, 200)

0 comments on commit 960374e

Please sign in to comment.