diff --git a/collector/tests.py b/collector/tests.py index 2d64ecd..4b9e55a 100644 --- a/collector/tests.py +++ b/collector/tests.py @@ -1,18 +1,18 @@ -from django.urls import reverse import pytest - from django.test import Client +from django.urls import reverse +from hypothesis import given, strategies as st from .models import Teil -def test_submitted_data_ends_up_in_database(client: Client): - data = "Test Diode 0815 grĂ¼n" +@given(data=st.text(alphabet=st.characters(exclude_categories=["C"]))) +def test_submitted_data_ends_up_in_database(data, session: Client): with pytest.raises(Teil.DoesNotExist): Teil.objects.get(name=data) - response = client.post(reverse("collector:enter"), data={"new_name": data}) + response = session.post(reverse("collector:enter"), data={"new_name": data}) assert response.status_code == 302 assert Teil.objects.get(name=data) diff --git a/requirements/dev.in b/requirements/dev.in index 402c19e..154c08f 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -2,6 +2,7 @@ django-extensions django-stubs +hypothesis[django] ipython pip-compile-multi pytest diff --git a/requirements/dev.txt b/requirements/dev.txt index c0e7216..5cca5aa 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,4 @@ -# SHA1:8c7b1dcee98fe0d76082d6a9af130adb2b2c5c9b +# SHA1:d0cece8f6bf419b959d3618afd4e5760e5a40a9a # # This file is autogenerated by pip-compile-multi # To update, run: @@ -7,6 +7,7 @@ # -r base.txt asttokens==3.0.0 +attrs==25.3.0 build==1.2.2.post1 click==8.1.8 decorator==5.2.1 @@ -14,6 +15,7 @@ django-extensions==3.2.3 django-stubs==5.1.3 django-stubs-ext==5.1.3 executing==2.2.0 +hypothesis==6.129.0 iniconfig==2.0.0 ipython==9.0.2 ipython-pygments-lexers==1.1.1 @@ -35,6 +37,7 @@ pytest==8.3.5 pytest-django==4.10.0 ruff==0.9.10 setuptools==76.0.0 +sortedcontainers==2.4.0 stack-data==0.6.3 toposort==1.10 traitlets==5.14.3