#86 Edit view tests

* extends view tests
This commit is contained in:
2022-02-10 11:45:55 +01:00
parent 8d573e7390
commit cba174b762
13 changed files with 109 additions and 34 deletions

View File

@@ -33,7 +33,7 @@
{% trans 'Title' %}
</th>
{% if is_default_member and has_access %}
<th scope="col">
<th class="w-10" scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@@ -34,7 +34,7 @@
{% trans 'Created' %}
</th>
{% if is_default_member and has_access %}
<th scope="col">
<th class="w-10" scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@@ -34,7 +34,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th scope="col">
<th class="w-10" scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@@ -34,7 +34,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th scope="col">
<th class="w-10" scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@@ -37,7 +37,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th scope="col">
<th class="w-10" scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@@ -40,12 +40,14 @@ class InterventionViewTestCase(BaseViewTestCase):
self.deduction.intervention = self.intervention
self.deduction.save()
self.deduction_new_url = reverse("intervention:new-deduction", args=(self.intervention.id,))
self.deduction_edit_url = reverse("intervention:edit-deduction", args=(self.intervention.id, self.deduction.id,))
self.deduction_remove_url = reverse("intervention:remove-deduction", args=(self.intervention.id, self.deduction.id))
self.revocation = Revocation.objects.create(
legal=self.intervention.legal
)
self.revocation_new_url = reverse("intervention:new-revocation", args=(self.intervention.id,))
self.revocation_edit_url = reverse("intervention:edit-revocation", args=(self.intervention.id, self.revocation.id))
self.revocation_remove_url = reverse("intervention:remove-revocation", args=(self.intervention.id, self.revocation.id))
def test_views_anonymous_user(self):
@@ -76,8 +78,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.run_check_url: f"{login_redirect_base}{self.run_check_url}",
self.record_url: f"{login_redirect_base}{self.record_url}",
self.deduction_new_url: f"{login_redirect_base}{self.deduction_new_url}",
self.deduction_edit_url: f"{login_redirect_base}{self.deduction_edit_url}",
self.deduction_remove_url: f"{login_redirect_base}{self.deduction_remove_url}",
self.revocation_new_url: f"{login_redirect_base}{self.revocation_new_url}",
self.revocation_edit_url: f"{login_redirect_base}{self.revocation_edit_url}",
self.revocation_remove_url: f"{login_redirect_base}{self.revocation_remove_url}",
}
@@ -115,8 +119,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.run_check_url,
self.record_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
@@ -151,8 +157,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.remove_url,
self.share_create_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
fail_urls = [
@@ -199,8 +207,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.log_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@@ -243,8 +253,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.record_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@@ -287,8 +299,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.record_url,
self.run_check_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@@ -331,8 +345,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.run_check_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@@ -375,8 +391,10 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.run_check_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
# Define urls where a redirect to a specific location is the proper response