Skip to content

Commit

Permalink
fix(url): fix test error that cause by redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
kaka-lin committed Mar 26, 2021
1 parent b1d70c3 commit 499d751
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/core/tests/test_middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
@pytest.mark.django_db
def test_locale_fallback_middleware(client, settings):
response = client.get('/en/', follow=True)
assert response.redirect_chain == [('/en-us/', 302)]
assert response.redirect_chain == [
('/en-us/', 302),
('/en-us/dashboard/', 302),
('/en-us/accounts/login/?next=/en-us/dashboard/', 302)]


@override_settings(USE_I18N=False)
Expand Down
2 changes: 1 addition & 1 deletion src/core/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@pytest.mark.django_db
def test_index_page(client):
response = client.get('/en-us/')
response = client.get('/en-us/', follow=True)
assert response.status_code == 200
assert 'PyCon' in response.content.decode('utf-8')

Expand Down

0 comments on commit 499d751

Please sign in to comment.