Collapse optional article search on filament forms

This commit is contained in:
Mikei386 committed 2026-11-14 17:24:29 +01:00
1 parent b69e1d37bd
commit 0287643b97
3 files changed
+38 -18

No files matched your search

+2
View File
@@ -144,6 +144,7 @@ class CatalogTests(CatalogTestCase):
url = f"/{path}/hinzufuegen/"
response = self.client.get(url)
article_input = response.context["lookup"]["article_number"].as_widget()
self.assertContains(response, '<details class="article-search">')
self.assertIn('name="article_number"', article_input)
self.assertNotIn("required", article_input)
self.assertRedirects(
@@ -151,6 +152,7 @@ class CatalogTests(CatalogTestCase):
)
self.assertEqual(model.objects.get(variant=self.spool).quantity, 1)
response = self.client.post(url, {"action": "lookup", "article_number": ""})
self.assertContains(response, '<details class="article-search" open>')
self.assertContains(response, "Bitte gib eine Artikelnummer ein.")
def test_article_lookup_prefills_both_forms_and_preserves_quantity(self):