Add plugin platform with modular backend and frontend registry.
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>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_plugin_manifest(api_client):
|
||||
response = api_client.get('/api/v1/plugins/')
|
||||
assert response.status_code == 200
|
||||
ids = [p['id'] for p in response.data]
|
||||
assert 'tags' in ids
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_tags_crud(api_client, sample_contact):
|
||||
create = api_client.post(
|
||||
'/api/v1/plugins/tags/contact-tags/',
|
||||
{'contact': sample_contact.id, 'label': 'коллеги'},
|
||||
format='json',
|
||||
)
|
||||
assert create.status_code == 201
|
||||
tag_id = create.data['id']
|
||||
|
||||
listing = api_client.get(f'/api/v1/plugins/tags/contact-tags/?contact_id={sample_contact.id}')
|
||||
assert listing.status_code == 200
|
||||
assert listing.data['count'] == 1
|
||||
|
||||
delete = api_client.delete(f'/api/v1/plugins/tags/contact-tags/{tag_id}/')
|
||||
assert delete.status_code == 204
|
||||
Reference in New Issue
Block a user