Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)