Add very basic tests
This commit is contained in:
parent
832763cb2a
commit
1424fdf3bb
5 changed files with 137 additions and 3 deletions
24
src/tests/conftest.py
Normal file
24
src/tests/conftest.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import pytest
|
||||
from servala.core.models import Organization, OrganizationMembership, User, OrganizationOrigin
|
||||
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def origin():
|
||||
return OrganizationOrigin.objects.create(name="TESTORIGIN")
|
||||
|
||||
@pytest.fixture
|
||||
def organization(origin):
|
||||
return Organization.objects.create(name="Test Org", origin=origin)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def other_organization(origin):
|
||||
return Organization.objects.create(name="Test Org Alternate", origin=origin)
|
||||
|
||||
@pytest.fixture
|
||||
def org_owner(organization):
|
||||
user = User.objects.create(email="user@example.org", password="example")
|
||||
OrganizationMembership.objects.create(organization=organization, user=user, role="owner")
|
||||
return user
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue