-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test_useful_info.py
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
def test_access_useful_info_page(super_admin_client): | ||
response = super_admin_client.get('/useful_info') | ||
assert response.status_code == 200 | ||
assert b'Useful Information' in response.data | ||
assert b'Currency' in response.data | ||
assert b'Weather' in response.data | ||
|
||
|
||
def test_currency_api(super_admin_client): | ||
response = super_admin_client.post('/currency') | ||
assert response.status_code == 200 | ||
assert b'base_currency' in response.data | ||
assert b'exchange_rate' in response.data | ||
assert b'target_currency' in response.data | ||
|
||
|
||
# check if I can use API: weather | ||
def test_weather_api(super_admin_client): | ||
response = super_admin_client.post('/weather', data={ | ||
'loc': 'Budapest' | ||
}) | ||
assert response.status_code == 200 | ||
assert b'Weather forecast' in response.data | ||
assert b'Temperature' in response.data | ||
assert b'Max Temperature' in response.data | ||
assert b'Min Temperature' in response.data | ||
assert b'Feels like' in response.data | ||
assert b'Wind Speed' in response.data | ||
assert b'Pressure' in response.data | ||
assert b'Humidity' in response.data | ||
assert b'Description' in response.data |