def test_superusers_can_dump_all_data(self): request = RequestFactory().get('/simplehmis/download_data') # Set the superuser as the request user. superuser = User.objects.get(username='******') request.user = superuser # Make sure the superuser gets a zipfile. response = admin.dump_hud_data(request) assert response.status_code == 200
def test_superusers_can_dump_all_data(self): request = RequestFactory().get('/simplehmis/download_data') # Set the superuser as the request user. superuser = User.objects.get(username='******') request.user = superuser # Make sure the superuser gets a zipfile. response = admin.dump_hud_data(request) assert response.status_code == 200
def test_dual_staff_cannot_dump_all_data(self): request = RequestFactory().get('/simplehmis/download_data') # Set the dual_admin as the request user. dual_admin = User.objects.get(username='******') request.user = dual_admin # Make sure the dual_admin cannot get the download. response = admin.dump_hud_data(request) assert response.status_code == 302 assert response.url.startswith(settings.LOGIN_URL)
def test_dual_staff_cannot_dump_all_data(self): request = RequestFactory().get('/simplehmis/download_data') # Set the dual_admin as the request user. dual_admin = User.objects.get(username='******') request.user = dual_admin # Make sure the dual_admin cannot get the download. response = admin.dump_hud_data(request) assert response.status_code == 302 assert response.url.startswith(settings.LOGIN_URL)