Require invited login and private downloads for the company pilot

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
tegwick 2026-09-11 16:35:13 +02:00
parent 56bf193193
commit b7d7828f30
27 changed files with 584 additions and 111 deletions

View file

@ -39,28 +39,28 @@ class NachweisFactory(factory.django.DjangoModelFactory):
@pytest.mark.django_db
def test_lose_liste_get(client):
def test_lose_liste_get(admitted_client):
a = AusschreibungFactory()
url = reverse('ausschreibungen:lose:liste', kwargs={'ausschreibung_id': a.pk})
response = client.get(url)
response = admitted_client.get(url)
assert response.status_code == 200
@pytest.mark.django_db
def test_los_neu_post(client):
def test_los_neu_post(admitted_client):
a = AusschreibungFactory()
url = reverse('ausschreibungen:lose:neu', kwargs={'ausschreibung_id': a.pk})
response = client.post(url, {'losnummer': 'L01', 'lostitel': 'Testlos'})
response = admitted_client.post(url, {'losnummer': 'L01', 'lostitel': 'Testlos'})
assert response.status_code == 302
assert Los.objects.filter(ausschreibung=a, losnummer='L01').exists()
@pytest.mark.django_db
def test_los_detail_get(client):
def test_los_detail_get(admitted_client):
los = LosFactory()
url = reverse('ausschreibungen:lose:detail',
kwargs={'ausschreibung_id': los.ausschreibung_id, 'los_pk': los.pk})
response = client.get(url)
response = admitted_client.get(url)
assert response.status_code == 200
@ -68,21 +68,21 @@ def test_los_detail_get(client):
@pytest.mark.django_db
def test_anforderung_neu_post_muss(client):
def test_anforderung_neu_post_muss(admitted_client):
a = AusschreibungFactory()
url = reverse('ausschreibungen:lose:anforderung_neu', kwargs={'ausschreibung_id': a.pk})
response = client.post(url, {'titel': 'Neue Anforderung', 'verbindlichkeit': 'muss',
response = admitted_client.post(url, {'titel': 'Neue Anforderung', 'verbindlichkeit': 'muss',
'erfuellungsstatus': 'offen'})
assert response.status_code == 302
assert Anforderung.objects.filter(ausschreibung=a, titel='Neue Anforderung').exists()
@pytest.mark.django_db
def test_anforderung_status_htmx(client):
def test_anforderung_status_htmx(admitted_client):
anf = AnforderungFactory()
url = reverse('ausschreibungen:lose:anforderung_status',
kwargs={'ausschreibung_id': anf.ausschreibung_id, 'pk': anf.pk})
response = client.post(url, {'erfuellungsstatus': 'nicht_erfuellbar'},
response = admitted_client.post(url, {'erfuellungsstatus': 'nicht_erfuellbar'},
HTTP_HX_REQUEST='true')
assert response.status_code == 200
anf.refresh_from_db()
@ -90,7 +90,7 @@ def test_anforderung_status_htmx(client):
@pytest.mark.django_db
def test_ausschlusskriterium_banner_shown(client):
def test_ausschlusskriterium_banner_shown(admitted_client):
a = AusschreibungFactory()
AnforderungFactory(
ausschreibung=a,
@ -98,17 +98,17 @@ def test_ausschlusskriterium_banner_shown(client):
erfuellungsstatus='nicht_erfuellbar',
)
url = reverse('ausschreibungen:entscheidung', kwargs={'pk': a.pk})
response = client.get(url)
response = admitted_client.get(url)
assert response.status_code == 200
assert b'Nicht erf\xc3\xbcllbare Ausschlusskriterien' in response.content
@pytest.mark.django_db
def test_nachweis_zuordnen(client):
def test_nachweis_zuordnen(admitted_client):
anf = AnforderungFactory()
n = NachweisFactory()
url = reverse('ausschreibungen:lose:nachweis_zuordnen',
kwargs={'ausschreibung_id': anf.ausschreibung_id, 'pk': anf.pk})
response = client.post(url, {'nachweis_pk': n.pk})
response = admitted_client.post(url, {'nachweis_pk': n.pk})
assert response.status_code == 200
assert anf.nachweise.filter(pk=n.pk).exists()