feat(itam): Add device model

!10 closes #12
This commit is contained in:
2024-05-23 21:26:50 +09:30
parent ef463b845d
commit 99a559fe6d
20 changed files with 519 additions and 38 deletions

View File

@ -36,3 +36,15 @@ def test_device_operating_system_version_only_one(user):
"""model deviceoperatingsystem must only contain one value per device
"""
pass
@pytest.mark.skip(reason="to be written")
def test_device_device_model_same_organization(user):
""" Can only add a device model from same organization """
pass
@pytest.mark.skip(reason="to be written")
def test_device_device_model_global(user):
""" Can add a device model that is set is_global=true """
pass

View File

@ -0,0 +1,38 @@
# from django.conf import settings
# from django.shortcuts import reverse
from django.test import TestCase, Client
import pytest
import unittest
import requests
# from django.contrib.auth import get_user_model
# from django.core.exceptions import ValidationError
# from access.models import Organization
# class Test_app_structure_auth(unittest.TestCase):
# User = get_user_model()
@pytest.mark.skip(reason="to be written")
def test_device_model_software_action(user):
"""Ensure only software that is from the same organization or is global can be added to the device
"""
pass
@pytest.mark.skip(reason="to be written")
def test_device_model_not_global(user):
"""Devices are not global items.
Ensure that a device can't be set to be global.
"""
pass
@pytest.mark.skip(reason="to be written")
def test_device_model_operating_system_version_only_one(user):
"""model deviceoperatingsystem must only contain one value per device
"""
pass

View File

@ -0,0 +1,19 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_device_model_create_has_organization():
""" Devices must be assigned an organization """
pass
@pytest.mark.skip(reason="to be written")
def test_device_model_edit_has_organization():
""" Devices must be assigned an organization """
pass

View File

@ -0,0 +1,87 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_history_auth_view():
""" User requires Permission view_history """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_operating_system_create():
""" History row must be added to history table on create
Must also have populated parent_item_pk and parent_item_class columns
"""
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_operating_system_update():
""" History row must be added to history table on update
Must also have populated parent_item_pk and parent_item_class columns
"""
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_operating_system_delete():
""" History row must be added to history table on delete
Must also have populated parent_item_pk and parent_item_class columns
"""
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_software_create():
""" History row must be added to history table on create
Must also have populated parent_item_pk and parent_item_class columns
"""
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_software_update():
""" History row must be added to history table on update
Must also have populated parent_item_pk and parent_item_class columns
"""
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_model_software_delete():
""" History row must be added to history table on delete
Must also have populated parent_item_pk and parent_item_class columns
"""
pass

View File

@ -0,0 +1,32 @@
# from django.conf import settings
# from django.shortcuts import reverse
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_device_model_auth_view(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_device_model_auth_add(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_device_model_auth_change(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_device_model_auth_delete(user):
""" Check correct permission for delete """
pass