* adds EMA test
pull/40/head
mpeltriaux 3 years ago
parent c221d00c28
commit 0fac17ad68

@ -120,6 +120,52 @@ class EmaViewTestCase(CompensationViewTestCase):
self.assert_url_fail(client, fail_urls) self.assert_url_fail(client, fail_urls)
self.assert_url_success(client, success_urls) self.assert_url_success(client, success_urls)
def test_logged_in_default_group_unshared(self):
""" Check correct status code for all requests
OVERWRITES DEFAULT COMPENSATION TEST METHOD DUE TO SPECIFIC BEHAVIOUR OF EMAS
Assumption: User logged in, is default group member and data is NOT shared
Normally default group would give access to all base functionalities. In case of EMAs we expect these
requests to fail, since a user must be part of the ets group as well, not only default.
We check on the same tests as in the _shared test, since we want to make sure there is no difference in
between shared and unshared, if the user is only part of the default group.
Returns:
"""
client = Client()
client.login(username=self.superuser.username, password=self.superuser_pw)
group = self.groups.get(name=DEFAULT_GROUP)
self.superuser.groups.set([group])
# Sharing does not have any effect in here, since the default group will prohibit further functionality access
# to this user
self.ema.users.set([])
success_urls = [
self.index_url,
self.detail_url,
self.report_url,
]
fail_urls = [
self.new_url,
self.new_id_url,
self.edit_url,
self.state_new_url,
self.action_new_url,
self.deadline_new_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
self.log_url,
self.remove_url,
]
self.assert_url_fail(client, fail_urls)
self.assert_url_success(client, success_urls)
def test_logged_in_ets_group_shared(self): def test_logged_in_ets_group_shared(self):
""" Check correct status code for all requests """ Check correct status code for all requests
@ -194,7 +240,3 @@ class EmaViewTestCase(CompensationViewTestCase):
] ]
self.assert_url_success(client, success_urls) self.assert_url_success(client, success_urls)
self.assert_url_fail(client, fail_urls) self.assert_url_fail(client, fail_urls)
def test_logged_in_default_group_unshared(self):
# overwrite this test, since it's not relevant for EMA but is inherited by the superclass
pass

@ -333,6 +333,7 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url, self.share_create_url,
self.run_check_url, self.run_check_url,
] ]
# Define urls where a redirect to a specific location is the proper response
success_urls_redirect = { success_urls_redirect = {
self.share_url: self.detail_url self.share_url: self.detail_url
} }

Loading…
Cancel
Save