mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-04 13:41:38 -04:00
add test
This commit is contained in:
@@ -1254,3 +1254,36 @@ def test_get_daily_sms_provider_volumes_report_calls_api_and_download_data(
|
||||
+ "80"
|
||||
+ "\r\n"
|
||||
)
|
||||
|
||||
|
||||
def test_get_users_report(client_request, platform_admin_user, mocker):
|
||||
mocker.patch(
|
||||
"app.main.views.platform_admin.user_api_client.get_all_users_detailed",
|
||||
return_value=[
|
||||
{
|
||||
"name": "Johnny Sokko",
|
||||
"email_address": "j_sokko@unicorn.gov",
|
||||
"mobile_number": "15555555555",
|
||||
"service": "Emperor, Guillotine, Service",
|
||||
}
|
||||
],
|
||||
)
|
||||
|
||||
client_request.login(platform_admin_user)
|
||||
response = client_request.get_response(
|
||||
"main.download_all_users",
|
||||
_data={},
|
||||
_expected_status=200,
|
||||
)
|
||||
|
||||
assert response.content_type == "text/csv; charset=utf-8"
|
||||
assert "attachment" in response.headers["Content-Disposition"]
|
||||
assert "filename" in response.headers["Content-Disposition"]
|
||||
assert "users" in response.headers["Content-Disposition"]
|
||||
|
||||
my_response = response.get_data(as_text=True)
|
||||
|
||||
assert "Johnny Sokko" in my_response
|
||||
assert "Emperor Guillotine Service" in my_response
|
||||
assert "j_sokko@unicorn.gov" in my_response
|
||||
assert "15555555555" in my_response
|
||||
|
||||
Reference in New Issue
Block a user