Skip to content

Commit

Permalink
[#4267] Add admin webtest
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Jun 18, 2024
1 parent 6f19b27 commit 511013f
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from django.urls import reverse

from django_webtest import WebTest
from maykin_2fa.test import disable_admin_mfa

from openforms.accounts.tests.factories import UserFactory

from ..models import ObjectsAPIGroupConfig


@disable_admin_mfa()
class ObjectsAPIGroupConfigAdminTest(WebTest):
def test_name(self):
ObjectsAPIGroupConfig.objects.create(name="test group")
user = UserFactory.create(is_superuser=True, is_staff=True)

response = self.app.get(
reverse("admin:registrations_objects_api_objectsapigroupconfig_changelist"),
user=user,
)

table = response.html.find("table", {"id": "result_list"})
row = table.find("tbody").find("tr")

self.assertEqual(row.find("th").string, "test group")

0 comments on commit 511013f

Please sign in to comment.