Skip to content

Commit

Permalink
✅ [#74] Add tests for the admin configuration pages
Browse files Browse the repository at this point in the history
Added a test to ensure that the certificates management link is
displayed.
  • Loading branch information
sergei-maertens committed Jul 22, 2024
1 parent d5c278c commit 0be6ac0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/test_admin.py
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))

0 comments on commit 0be6ac0

Please sign in to comment.