mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-19 05:09:40 +02:00
feat: Groups/households custom invitations (#4252)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
parent
7ada42a791
commit
622c1b11f5
8 changed files with 276 additions and 106 deletions
|
@ -1,3 +1,5 @@
|
|||
from uuid import uuid4
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
|
@ -31,6 +33,21 @@ def test_get_all_invitation(api_client: TestClient, unique_user: TestUser, invit
|
|||
assert item["token"] == invite
|
||||
|
||||
|
||||
def test_create_invitation(api_client: TestClient, unique_user: TestUser) -> None:
|
||||
# Create invitation for the same group as user
|
||||
r = api_client.post(api_routes.households_invitations, json={"uses": 1}, headers=unique_user.token)
|
||||
assert r.status_code == 201
|
||||
|
||||
# Create invitation for other group as user
|
||||
body = {
|
||||
"uses": 1,
|
||||
"groupId": str(uuid4()),
|
||||
"householdId": str(uuid4()),
|
||||
}
|
||||
r = api_client.post(api_routes.households_invitations, json=body, headers=unique_user.token)
|
||||
assert r.status_code == 403
|
||||
|
||||
|
||||
def register_user(api_client: TestClient, invite: str):
|
||||
# Test User can Join Group
|
||||
registration = user_registration_factory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue