Split graph/import/meta into Django apps, add API v1 with OpenAPI and pytest, and introduce plugin registry with the tags reference plugin on both FE and BE. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
606 B
Python
27 lines
606 B
Python
import pytest
|
|
from contacts.models import Contact, Relation
|
|
|
|
|
|
@pytest.fixture
|
|
def api_client():
|
|
from rest_framework.test import APIClient
|
|
return APIClient()
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_contact(db):
|
|
return Contact.objects.create(name='Иван Иванов', email='ivan@test.com')
|
|
|
|
|
|
@pytest.fixture
|
|
def two_contacts(db):
|
|
a = Contact.objects.create(name='Алиса')
|
|
b = Contact.objects.create(name='Боб')
|
|
return a, b
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_relation(db, two_contacts):
|
|
a, b = two_contacts
|
|
return Relation.objects.create(source=a, target=b, relation_type='friend')
|