Skip to content

Commit

Permalink
Move misago.admin tests to pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Dec 26, 2018
1 parent a808326 commit 1fdfe58
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 306 deletions.
41 changes: 0 additions & 41 deletions misago/admin/tests/test_admin_hierarchy.py

This file was deleted.

76 changes: 0 additions & 76 deletions misago/admin/tests/test_admin_index.py

This file was deleted.

77 changes: 0 additions & 77 deletions misago/admin/tests/test_admin_views.py

This file was deleted.

111 changes: 0 additions & 111 deletions misago/admin/tests/test_auth.py

This file was deleted.

2 changes: 1 addition & 1 deletion misago/admin/views/generic/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def dispatch(
"%s%s" % (reverse(self.root_link), context["querystring"])
)

if refresh_querystring and not request.GET.get("redirected"):
if refresh_querystring and "redirected" not in request.GET:
return redirect("%s%s" % (request.path, context["querystring"]))

return self.render(request, context)
Expand Down
6 changes: 6 additions & 0 deletions misago/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ def assert_contains(response, string, status_code=200):
assert response.status_code == status_code
fail_message = f'"{string}" not found in response.content'
assert string in response.content.decode("utf-8"), fail_message


def assert_not_contains(response, string, status_code=200):
assert response.status_code == status_code
fail_message = f'"{string}" was found in response.content'
assert string not in response.content.decode("utf-8"), fail_message

0 comments on commit 1fdfe58

Please sign in to comment.