tests.experimental.integrations.conftest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A FakeDjangoModel.__init__() 0 2 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A django_integration() 0 3 1
1
from typing import Any
2
3
import pytest
4
5
from lagom import Container
6
from lagom.experimental.integrations.django import DjangoIntegration
7
8
9
class FakeDjangoManager:
10
    pass
11
12
13
class FakeDjangoModel:
14
    data: Any
15
    objects = FakeDjangoManager()
16
    custom_manager = FakeDjangoManager()
17
18
    def __init__(self, **kwargs):
19
        self.data = kwargs
20
21
22
@pytest.fixture(scope="function")
23
def django_integration():
24
    return DjangoIntegration(Container(), models=[FakeDjangoModel])
25