You've already forked hotpocket
BTHLABS-83: View association view raises 403 when opened as anonymous
Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl> Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
@@ -325,7 +325,19 @@ def test_inactive_account(inactive_account_client: Client,
|
||||
)
|
||||
|
||||
# Then
|
||||
assert result.status_code == http.HTTPStatus.FORBIDDEN
|
||||
asserts.assertRedirects(
|
||||
result,
|
||||
reverse(
|
||||
'ui.accounts.login',
|
||||
query=[
|
||||
(
|
||||
'next',
|
||||
reverse('ui.associations.view', args=(association_out.pk,)),
|
||||
),
|
||||
],
|
||||
),
|
||||
fetch_redirect_response=False,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@@ -338,4 +350,16 @@ def test_anonymous(client: Client,
|
||||
)
|
||||
|
||||
# Then
|
||||
assert result.status_code == http.HTTPStatus.FORBIDDEN
|
||||
asserts.assertRedirects(
|
||||
result,
|
||||
reverse(
|
||||
'ui.accounts.login',
|
||||
query=[
|
||||
(
|
||||
'next',
|
||||
reverse('ui.associations.view', args=(association_out.pk,)),
|
||||
),
|
||||
],
|
||||
),
|
||||
fetch_redirect_response=False,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user