-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ [#74] Add tests for the admin configuration pages
Added a test to ensure that the certificates management link is displayed.
- Loading branch information
1 parent
d5c278c
commit 0be6ac0
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from django.test import Client | ||
from django.urls import reverse | ||
from django.utils.translation import gettext as _ | ||
|
||
import pytest | ||
from pytest_django.asserts import assertContains | ||
|
||
from digid_eherkenning.models import DigidConfiguration, EherkenningConfiguration | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_digid_configuration_admin_certificates_link( | ||
admin_client: Client, | ||
digid_config: DigidConfiguration, | ||
): | ||
url = reverse("admin:digid_eherkenning_digidconfiguration_change", args=(1,)) | ||
|
||
response = admin_client.get(url) | ||
|
||
assert response.status_code == 200 | ||
assertContains(response, _("certificates")) | ||
assertContains(response, _("Manage ({count})").format(count=1)) | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_eherkenning_configuration_admin_certificates_link( | ||
admin_client: Client, | ||
eherkenning_config: EherkenningConfiguration, | ||
): | ||
url = reverse("admin:digid_eherkenning_eherkenningconfiguration_change", args=(1,)) | ||
|
||
response = admin_client.get(url) | ||
|
||
assert response.status_code == 200 | ||
assertContains(response, _("certificates")) | ||
assertContains(response, _("Manage ({count})").format(count=1)) |