MCPcopy
hub / github.com/makeplane/plane / setup_instance

Function setup_instance

apps/api/plane/tests/contract/app/test_authentication.py:21–37  ·  view source on GitHub ↗

Create and configure an instance for authentication tests

(db)

Source from the content-addressed store, hash-verified

19
20@pytest.fixture
21def setup_instance(db):
22 """Create and configure an instance for authentication tests"""
23 instance_id = uuid.uuid4() if not Instance.objects.exists() else Instance.objects.first().id
24
25 # Create or update instance with all required fields
26 instance, _ = Instance.objects.update_or_create(
27 id=instance_id,
28 defaults={
29 "instance_name": "Test Instance",
30 "instance_id": str(uuid.uuid4()),
31 "current_version": "1.0.0",
32 "domain": "http://localhost:8000",
33 "last_checked_at": timezone.now(),
34 "is_setup_done": True,
35 },
36 )
37 return instance
38
39
40@pytest.fixture

Callers

nothing calls this directly

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected