-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,8 @@ def test_health_for_locale(self, with_client): | |
def test_access_without_authentication_token(self, with_client): | ||
# response = client.get("/login") | ||
# assert response.status_code == 401 | ||
response = with_client.get('/me') | ||
assert response.status_code == 401 | ||
response = with_client.put('/me') | ||
assert response.status_code == 401 | ||
response = with_client.get('/me/calendars') | ||
|
@@ -52,18 +54,52 @@ def test_access_without_authentication_token(self, with_client): | |
assert response.status_code == 401 | ||
response = with_client.delete('/cal/1') | ||
assert response.status_code == 401 | ||
response = with_client.post('/caldav/auth') | ||
assert response.status_code == 401 | ||
response = with_client.post('/caldav/disconnect') | ||
assert response.status_code == 401 | ||
response = with_client.post('/rmt/calendars') | ||
assert response.status_code == 401 | ||
response = with_client.get('/rmt/cal/1/' + DAY1 + '/' + DAY5) | ||
assert response.status_code == 401 | ||
response = with_client.post('/rmt/sync') | ||
assert response.status_code == 401 | ||
response = with_client.get('/account/available-emails') | ||
assert response.status_code == 401 | ||
response = with_client.get('/account/download') | ||
assert response.status_code == 401 | ||
response = with_client.get('/account/external-connections/') | ||
assert response.status_code == 401 | ||
response = with_client.delete('/account/delete') | ||
assert response.status_code == 401 | ||
response = with_client.get('/google/auth') | ||
assert response.status_code == 401 | ||
response = with_client.post('/google/disconnect') | ||
assert response.status_code == 401 | ||
response = with_client.post('/schedule') | ||
assert response.status_code == 401 | ||
response = with_client.get('/schedule') | ||
assert response.status_code == 401 | ||
response = with_client.get('/schedule/0') | ||
assert response.status_code == 401 | ||
response = with_client.put('/schedule/0') | ||
assert response.status_code == 401 | ||
response = with_client.get('/invite') | ||
assert response.status_code == 401 | ||
response = with_client.post('/invite/generate/1') | ||
assert response.status_code == 401 | ||
response = with_client.put('/invite/revoke/1') | ||
assert response.status_code == 401 | ||
response = with_client.get('/subscriber') | ||
assert response.status_code == 401 | ||
response = with_client.put('/subscriber/enable/[email protected]') | ||
assert response.status_code == 401 | ||
response = with_client.put('/subscriber/disable/[email protected]') | ||
assert response.status_code == 401 | ||
response = with_client.post('/subscriber/setup') | ||
assert response.status_code == 401 | ||
response = with_client.post('/waiting-list/invite') | ||
assert response.status_code == 401 | ||
|
||
def test_send_feedback(self, with_client): | ||
response = with_client.post( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,3 +52,18 @@ def test_signed_short_link_refresh(self, with_client): | |
assert response.status_code == 200, response.text | ||
url_new = response.json()['url'] | ||
assert url_old != url_new | ||
|
||
def test_update_me_username_taken(self, with_db, with_client, make_pro_subscriber): | ||
"""Attempt to update current subscriber's profile with already existing username""" | ||
other_subscriber = make_pro_subscriber(username='thunderbird1') | ||
|
||
response = with_client.put( | ||
'/me', | ||
json={ | ||
'username': 'thunderbird1', | ||
'name': 'Changed Name', | ||
'secondary_email': '[email protected]', | ||
}, | ||
headers=auth_headers, | ||
) | ||
assert response.status_code == 403, response.text |