26
app/tests/fixtures/__init__.py
vendored
26
app/tests/fixtures/__init__.py
vendored
@ -63,6 +63,16 @@ from .model_device import (
|
||||
model_device,
|
||||
)
|
||||
|
||||
from .model_devicemodel import (
|
||||
kwargs_devicemodel,
|
||||
model_devicemodel,
|
||||
)
|
||||
|
||||
from .model_devicetype import (
|
||||
kwargs_devicetype,
|
||||
model_devicetype,
|
||||
)
|
||||
|
||||
from .model_featureflag import (
|
||||
kwargs_featureflag,
|
||||
model_featureflag,
|
||||
@ -88,6 +98,11 @@ from .model_knowledgebasecategory import (
|
||||
model_knowledgebasecategory,
|
||||
)
|
||||
|
||||
from .model_manufacturer import (
|
||||
kwargs_manufacturer,
|
||||
model_manufacturer,
|
||||
)
|
||||
|
||||
from .model_permission import (
|
||||
model_permission,
|
||||
)
|
||||
@ -102,6 +117,7 @@ from .model_softwareenablefeatureflag import (
|
||||
)
|
||||
|
||||
from .model_team import (
|
||||
kwargs_team,
|
||||
model_team,
|
||||
)
|
||||
|
||||
@ -114,6 +130,16 @@ from .model_tenancyabstract import (
|
||||
model_tenancyabstract,
|
||||
)
|
||||
|
||||
from .model_ticketcategory import (
|
||||
kwargs_ticketcategory,
|
||||
model_ticketcategory,
|
||||
)
|
||||
|
||||
from .model_ticketcommentcategory import (
|
||||
kwargs_ticketcommentcategory,
|
||||
model_ticketcommentcategory,
|
||||
)
|
||||
|
||||
from .model_user import (
|
||||
kwargs_user,
|
||||
model_user,
|
||||
|
@ -12,7 +12,8 @@ def model_centurionmodelnote():
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_centurionmodelnote(django_db_blocker, kwargs_centurionmodel, kwargs_user, model_user):
|
||||
def kwargs_centurionmodelnote(django_db_blocker,
|
||||
model_contenttype, kwargs_centurionmodel, kwargs_user, model_user):
|
||||
|
||||
kwargs = kwargs_centurionmodel.copy()
|
||||
del kwargs['model_notes']
|
||||
@ -34,7 +35,10 @@ def kwargs_centurionmodelnote(django_db_blocker, kwargs_centurionmodel, kwargs_u
|
||||
**kwargs,
|
||||
'body': 'a random note',
|
||||
'created_by': user,
|
||||
'content_type': 'fixture sets value',
|
||||
'content_type': model_contenttype.objects.get(
|
||||
app_label = user._meta.app_label,
|
||||
model = user._meta.model_name,
|
||||
),
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
||||
|
9
app/tests/fixtures/model_configgrouphost.py
vendored
9
app/tests/fixtures/model_configgrouphost.py
vendored
@ -13,7 +13,7 @@ def model_configgrouphosts():
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_configgrouphosts(django_db_blocker,
|
||||
kwargs_device, model_device,
|
||||
kwargs_centurionmodel, model_configgroup, kwargs_configgroup,
|
||||
kwargs_centurionmodel, model_configgroups, kwargs_configgroups,
|
||||
):
|
||||
|
||||
|
||||
@ -25,20 +25,21 @@ def kwargs_configgrouphosts(django_db_blocker,
|
||||
|
||||
host_kwargs = kwargs_device.copy()
|
||||
host_kwargs.update({
|
||||
'name': 'cgh' + str(random_str).replace(' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
'name': 'cgh' + str(random_str).replace(
|
||||
' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
'organization': centurion_kwargs['organization']
|
||||
})
|
||||
|
||||
host = model_device.objects.create( **host_kwargs )
|
||||
|
||||
|
||||
group_kwargs = kwargs_configgroup.copy()
|
||||
group_kwargs = kwargs_configgroups.copy()
|
||||
group_kwargs.update({
|
||||
'name': 'cgg' + random_str,
|
||||
'organization': centurion_kwargs['organization']
|
||||
})
|
||||
|
||||
group = model_configgroup.objects.create( **group_kwargs )
|
||||
group = model_configgroups.objects.create( **group_kwargs )
|
||||
|
||||
kwargs = {
|
||||
**centurion_kwargs,
|
||||
|
@ -15,7 +15,7 @@ def model_configgroupsoftware():
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_configgroupsoftware(django_db_blocker,
|
||||
kwargs_software, model_software,
|
||||
kwargs_centurionmodel, model_configgroup, kwargs_configgroup,
|
||||
kwargs_centurionmodel, model_configgroups, kwargs_configgroups,
|
||||
):
|
||||
|
||||
|
||||
@ -34,13 +34,13 @@ def kwargs_configgroupsoftware(django_db_blocker,
|
||||
software = model_software.objects.create( **software_kwargs )
|
||||
|
||||
|
||||
group_kwargs = kwargs_configgroup.copy()
|
||||
group_kwargs = kwargs_configgroups.copy()
|
||||
group_kwargs.update({
|
||||
'name': 'cgg' + random_str,
|
||||
'organization': centurion_kwargs['organization']
|
||||
})
|
||||
|
||||
group = model_configgroup.objects.create( **group_kwargs )
|
||||
group = model_configgroups.objects.create( **group_kwargs )
|
||||
|
||||
kwargs = {
|
||||
**centurion_kwargs,
|
||||
|
3
app/tests/fixtures/model_device.py
vendored
3
app/tests/fixtures/model_device.py
vendored
@ -18,7 +18,8 @@ def kwargs_device(kwargs_centurionmodel):
|
||||
|
||||
kwargs = {
|
||||
**kwargs_centurionmodel.copy(),
|
||||
'name': 'dev' + str(random_str).replace(' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
'name': 'dev' + str(random_str).replace(
|
||||
' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
||||
|
25
app/tests/fixtures/model_devicemodel.py
vendored
Normal file
25
app/tests/fixtures/model_devicemodel.py
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import datetime
|
||||
import pytest
|
||||
|
||||
from itam.models.device import DeviceModel
|
||||
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_devicemodel():
|
||||
|
||||
yield DeviceModel
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_devicemodel(kwargs_centurionmodel):
|
||||
|
||||
random_str = str(datetime.datetime.now(tz=datetime.timezone.utc))
|
||||
|
||||
kwargs = {
|
||||
**kwargs_centurionmodel.copy(),
|
||||
'name': 'dev' + str(random_str).replace(
|
||||
' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
25
app/tests/fixtures/model_devicetype.py
vendored
Normal file
25
app/tests/fixtures/model_devicetype.py
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import datetime
|
||||
import pytest
|
||||
|
||||
from itam.models.device import DeviceType
|
||||
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_devicetype():
|
||||
|
||||
yield DeviceType
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_devicetype(kwargs_centurionmodel):
|
||||
|
||||
random_str = str(datetime.datetime.now(tz=datetime.timezone.utc))
|
||||
|
||||
kwargs = {
|
||||
**kwargs_centurionmodel.copy(),
|
||||
'name': 'typ' + str(random_str).replace(
|
||||
' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
25
app/tests/fixtures/model_manufacturer.py
vendored
Normal file
25
app/tests/fixtures/model_manufacturer.py
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import datetime
|
||||
import pytest
|
||||
|
||||
from core.models.manufacturer import Manufacturer
|
||||
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_manufacturer():
|
||||
|
||||
yield Manufacturer
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_manufacturer(kwargs_centurionmodel):
|
||||
|
||||
random_str = str(datetime.datetime.now(tz=datetime.timezone.utc))
|
||||
|
||||
kwargs = {
|
||||
**kwargs_centurionmodel.copy(),
|
||||
'name': 'man' + str(random_str).replace(
|
||||
' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
16
app/tests/fixtures/model_team.py
vendored
16
app/tests/fixtures/model_team.py
vendored
@ -1,9 +1,23 @@
|
||||
import datetime
|
||||
import pytest
|
||||
|
||||
from access.models.team import Team
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_team(request):
|
||||
def model_team():
|
||||
|
||||
yield Team
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_team(kwargs_centurionmodel):
|
||||
|
||||
random_str = str(datetime.datetime.now(tz=datetime.timezone.utc))
|
||||
|
||||
kwargs = {
|
||||
**kwargs_centurionmodel.copy(),
|
||||
'team_name': 'tm_' + random_str,
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
||||
|
25
app/tests/fixtures/model_ticketcategory.py
vendored
Normal file
25
app/tests/fixtures/model_ticketcategory.py
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import datetime
|
||||
import pytest
|
||||
|
||||
from core.models.ticket.ticket_category import TicketCategory
|
||||
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_ticketcategory():
|
||||
|
||||
yield TicketCategory
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_ticketcategory(kwargs_centurionmodel):
|
||||
|
||||
random_str = str(datetime.datetime.now(tz=datetime.timezone.utc))
|
||||
|
||||
kwargs = {
|
||||
**kwargs_centurionmodel.copy(),
|
||||
'name': 'tc' + str(random_str).replace(
|
||||
' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
25
app/tests/fixtures/model_ticketcommentcategory.py
vendored
Normal file
25
app/tests/fixtures/model_ticketcommentcategory.py
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import datetime
|
||||
import pytest
|
||||
|
||||
from core.models.ticket.ticket_comment_category import TicketCommentCategory
|
||||
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def model_ticketcommentcategory():
|
||||
|
||||
yield TicketCommentCategory
|
||||
|
||||
|
||||
@pytest.fixture( scope = 'class')
|
||||
def kwargs_ticketcommentcategory(kwargs_centurionmodel):
|
||||
|
||||
random_str = str(datetime.datetime.now(tz=datetime.timezone.utc))
|
||||
|
||||
kwargs = {
|
||||
**kwargs_centurionmodel.copy(),
|
||||
'name': 'tcc' + str(random_str).replace(
|
||||
' ', '').replace(':', '').replace('+', '').replace('.', ''),
|
||||
}
|
||||
|
||||
yield kwargs.copy()
|
Reference in New Issue
Block a user