mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-21 05:53:36 -07:00
feat(backend): ✨ start multi-tenant support (WIP) (#680)
* fix ts types * feat(code-generation): ♻️ update code-generation formats * new scope * add step button * fix linter error * update code-generation tags * feat(backend): ✨ start multi-tenant support * feat(backend): ✨ group invitation token generation and signup * refactor(backend): ♻️ move group admin actions to admin router * set url base to include `/admin` * feat(frontend): ✨ generate user sign-up links * test(backend): ✅ refactor test-suite to further decouple tests (WIP) * feat(backend): 🐛 assign owner on backup import for recipes * fix(backend): 🐛 assign recipe owner on migration from other service Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
parent
3c504e7048
commit
bdaf758712
90 changed files with 1793 additions and 949 deletions
25
tests/integration_tests/user_tests/test_user_login.py
Normal file
25
tests/integration_tests/user_tests/test_user_login.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import json
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from tests.app_routes import AppRoutes
|
||||
|
||||
|
||||
def test_failed_login(api_client: TestClient, api_routes: AppRoutes):
|
||||
form_data = {"username": "changeme@email.com", "password": "WRONG_PASSWORD"}
|
||||
response = api_client.post(api_routes.auth_token, form_data)
|
||||
|
||||
assert response.status_code == 401
|
||||
|
||||
|
||||
def test_superuser_login(api_client: TestClient, api_routes: AppRoutes, admin_token):
|
||||
form_data = {"username": "changeme@email.com", "password": "MyPassword"}
|
||||
response = api_client.post(api_routes.auth_token, form_data)
|
||||
|
||||
assert response.status_code == 200
|
||||
new_token = json.loads(response.text).get("access_token")
|
||||
|
||||
response = api_client.get(api_routes.users_self, headers=admin_token)
|
||||
assert response.status_code == 200
|
||||
|
||||
return {"Authorization": f"Bearer {new_token}"}
|
Loading…
Add table
Add a link
Reference in a new issue