test: adjust test layout and update contributing

!9 #15
This commit is contained in:
2024-05-23 15:37:06 +09:30
parent 724c52b777
commit 9e1a024a12
33 changed files with 979 additions and 572 deletions

View File

@ -35,7 +35,46 @@ python3 manage.py makemigrations --noinput
Updates to python modules will need to be captured with SCM. This can be done by running `pip freeze > requirements.txt` from the running virtual environment.
## Running Tests
## Tests
!!! danger "Requirement"
All models **are** to have tests written for them, Including testing between dependent models.
To ensure consistency and reliability of this application, tests are to be written. Each test is to test one item ONLY and no more. Each module is to contain a tests directory of the model being tested with a single file for grouping of what is being tested. for items that depend upon a parent model, the test file is to be within the child-models test directory named with format `test_<model>_<parent app>_<parent model name>`
_example structure for the device model that relies upon access app model organization, core app model history and model notes._
``` text
├── tests
│   ├── device
│   │   ├── test_device_access_organization.py
│   │   ├── test_device_api_permission.py
│   │   ├── test_device_core_history.py
│   │   ├── test_device_core_notes.py
│   │   ├── test_device_permission.py
│   │   └── test_device.py
```
Items to test include but are not limited to:
- CRUD permissions admin site
- CRUD permissions api site
- CRUD permissions main site
- can only access organization object
- can access global object (still to require model CRUD permission)
- parent models
### Running Tests
test can be run by running the following:

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_organization_auth_view(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_organization_auth_add(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_organization_auth_change(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_organization_auth_delete(user):
""" Check correct permission for delete """
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_organization_auth_view_api(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_organization_auth_add_api(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_organization_auth_change_api(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_organization_auth_delete_api(user):
""" Check correct permission for delete """
pass

View File

@ -0,0 +1,10 @@
from django.test import TestCase
import pytest
import requests
import unittest
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from access.models import Organization, Team

View File

@ -0,0 +1,46 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_history_organization_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_team_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_team_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_team_delete():
""" History row must be added to history table on delete """
pass

View File

@ -0,0 +1,43 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_history_team_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_delete():
""" History row must be added to history table on delete """
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_team_auth_view(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_team_auth_add(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_team_auth_change(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_team_auth_delete(user):
""" Check correct permission for delete """
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_team_auth_view_api(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_team_auth_add_api(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_team_auth_change_api(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_team_auth_delete_api(user):
""" Check correct permission for delete """
pass

View File

@ -0,0 +1,24 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_history_team_users_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_delete():
""" History row must be added to history table on delete """
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_team_user_auth_view(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_team_user_auth_add(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_team_user_auth_change(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_team_user_auth_delete(user):
""" Check correct permission for delete """
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_team_user_auth_view_api(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_team_user_auth_add_api(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_team_user_auth_change_api(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_team_user_auth_delete_api(user):
""" Check correct permission for delete """
pass

View File

@ -22,188 +22,6 @@ def test_api_access_home(user):
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_view_organization(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_view_team(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_add_organization(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_add_team(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_change_organization(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_change_team(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_delete_organization(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_delete_team(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_view_device(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_add_device(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_change_device(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_delete_device(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_view_software(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_add_software(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_change_software(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass
@pytest.mark.skip(reason="to be written")
def test_api_access_model_delete_software(user):
"""Ensure api model access
test_api_access_model_view_organization = test_api_access_model_<action>_<model name>
Test to ensure that action can only occur when authenticated and against the model
"""
pass

View File

@ -8,245 +8,24 @@ import requests
@pytest.mark.skip(reason="to be written")
def test_history_device_create():
""" History row must be added to history table on create """
def test_history_auth_view_super_admin():
""" Super Admin can view history without requiring permission """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_update():
""" History row must be added to history table on updatej """
pass
def test_history_no_entry_without_item():
""" A history entry cant be created without an item
@pytest.mark.skip(reason="to be written")
def test_history_device_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_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
fields required `item_pk` and `item_class`
"""
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_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
def test_history_no_entry_without_parent_item():
""" A history entry cant be created without a parent item
fields required `parent_item_pk` and `parent_item_class
"""
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_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_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_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_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
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_version_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_operating_system_version_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_operating_system_version_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_software_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_software_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_software_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_software_version_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_software_version_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_software_version_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_organization_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_team_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_team_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_organization_team_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_team_users_delete():
""" History row must be added to history table on delete """
pass

View File

@ -7,33 +7,6 @@ import requests
@pytest.mark.skip(reason="to be written")
def test_note_device_no_blank_note():
""" The field is set to blank=true, ensure that a blank note cant be saved
field had to be set blank=true so that other forms on same page could be saved.
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_operating_system_no_blank_note():
""" The field is set to blank=true, ensure that a blank note cant be saved
field had to be set blank=true so that other forms on same page could be saved.
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_software_no_blank_note():
""" The field is set to blank=true, ensure that a blank note cant be saved
field had to be set blank=true so that other forms on same page could be saved.
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_new_correct_usercreated():
""" The user who added the note must be added to the note """
@ -46,130 +19,3 @@ def test_note_new_correct_usermodified():
pass
@pytest.mark.skip(reason="to be written")
def test_note_new_correct_device():
""" On creation of device note the device must be added """
pass
@pytest.mark.skip(reason="to be written")
def test_note_new_correct_operating_system():
""" On creation of operating system note the operating system must be added """
pass
@pytest.mark.skip(reason="to be written")
def test_note_new_correct_software():
""" On creation of software note the software must be added """
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_view_device():
""" Ensure that if the user doesn't have view permissions for notes, they can't see any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_add_device():
""" Ensure that if the user doesn't have add permissions for notes, they can't add any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_edit_device():
""" Ensure that if the user doesn't have edit permissions for notes, they can't edit any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_delete_device():
""" Ensure that if the user doesn't have delete permissions for notes, they can't delete any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_view_operating_system():
""" Ensure that if the user doesn't have view permissions for notes, they can't see any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_add_operating_system():
""" Ensure that if the user doesn't have add permissions for notes, they can't add any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_edit_operating_system():
""" Ensure that if the user doesn't have edit permissions for notes, they can't edit any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_delete_operating_system():
""" Ensure that if the user doesn't have delete permissions for notes, they can't delete any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_view_software():
""" Ensure that if the user doesn't have view permissions for notes, they can't see any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_add_software():
""" Ensure that if the user doesn't have add permissions for notes, they can't add any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_edit_software():
""" Ensure that if the user doesn't have edit permissions for notes, they can't edit any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_delete_software():
""" Ensure that if the user doesn't have delete permissions for notes, they can't delete any notes
user must also have view permissions for the opject the note is for
"""
pass

View File

@ -17,7 +17,7 @@ from itam.models.software import Software
class View(OrganizationPermission, generic.View):
permission_required = [
'itam.view_softwareversion'
'itam.view_history'
]
template_name = 'history.html.j2'

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_create_has_organization():
""" Devices must be assigned an organization """
pass
@pytest.mark.skip(reason="to be written")
def test_device_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_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_device_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_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_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_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_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_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,58 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_note_device_no_blank_note():
""" The field is set to blank=true, ensure that a blank note cant be saved
field had to be set blank=true so that other forms on same page could be saved.
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_new_correct_device():
""" On creation of device note the device must be added """
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_view_device():
""" Ensure that if the user doesn't have view permissions for notes, they can't see any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_add_device():
""" Ensure that if the user doesn't have add permissions for notes, they can't add any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_edit_device():
""" Ensure that if the user doesn't have edit permissions for notes, they can't edit any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_delete_device():
""" Ensure that if the user doesn't have delete permissions for notes, they can't delete any notes
user must also have view permissions for the opject the note is for
"""
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_auth_view(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_device_auth_add(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_device_auth_change(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_device_auth_delete(user):
""" Check correct permission for delete """
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_auth_view_api(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_device_auth_add_api(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_device_auth_change_api(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_device_auth_delete_api(user):
""" Check correct permission for delete """
pass

View File

@ -23,7 +23,7 @@ def test_operating_system_update_is_global_no_change(user):
@pytest.mark.skip(reason="to be written")
def test_operating_system_prevent_delete_if_used(user):
"""Any operating_system in use by a device must not be deleted.
"""Any operating_system in use by a operating_system must not be deleted.
i.e. A global os can't be deleted
"""
@ -35,7 +35,7 @@ def test_operating_system_prevent_delete_if_used(user):
def test_operating_system_version_installs_by_os_count(user):
"""Operating System Versions has a count field that must be accurate
The count is of model OperatingSystemVersion linked to model DeviceOperatingSystem
The count is of model OperatingSystemVersion linked to model operating_systemOperatingSystem
"""
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_operating_system_create_has_organization():
""" Operating Systems must be assigned an organization """
pass
@pytest.mark.skip(reason="to be written")
def test_operating_system_edit_has_organization():
""" Operating Systems must be assigned an organization """
pass

View File

@ -0,0 +1,52 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_operating_system_version_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_operating_system_version_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_operating_system_version_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,51 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_note_new_correct_operating_system():
""" On creation of operating system note the operating system must be added """
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_view_operating_system():
""" Ensure that if the user doesn't have view permissions for notes, they can't see any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_add_operating_system():
""" Ensure that if the user doesn't have add permissions for notes, they can't add any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_edit_operating_system():
""" Ensure that if the user doesn't have edit permissions for notes, they can't edit any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_delete_operating_system():
""" Ensure that if the user doesn't have delete permissions for notes, they can't delete any notes
user must also have view permissions for the opject the note is for
"""
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_operating_system_auth_view(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_operating_system_auth_add(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_operating_system_auth_change(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_operating_system_auth_delete(user):
""" Check correct permission for delete """
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_operating_system_auth_view_api(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_operating_system_auth_add_api(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_operating_system_auth_change_api(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_operating_system_auth_delete_api(user):
""" Check correct permission for delete """
pass

View File

@ -23,9 +23,9 @@ def test_software_update_is_global_no_change(user):
@pytest.mark.skip(reason="to be written")
def test_software_prevent_delete_if_used(user):
"""Any software in use by a device must not be deleted.
"""Any software in use by a software must not be deleted.
i.e. A device has an action set for the software.
i.e. A software has an action set for the software.
"""
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_software_create_has_organization():
""" Software must be assigned an organization """
pass
@pytest.mark.skip(reason="to be written")
def test_software_edit_has_organization():
""" Software must be assigned an organization """
pass

View File

@ -0,0 +1,52 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_history_software_create():
""" History row must be added to history table on create """
pass
@pytest.mark.skip(reason="to be written")
def test_history_software_update():
""" History row must be added to history table on updatej """
pass
@pytest.mark.skip(reason="to be written")
def test_history_software_delete():
""" History row must be added to history table on delete """
pass
@pytest.mark.skip(reason="to be written")
def test_history_software_version_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_software_version_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_software_version_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,61 @@
from django.test import TestCase, Client
import pytest
import unittest
import requests
@pytest.mark.skip(reason="to be written")
def test_note_software_no_blank_note():
""" The field is set to blank=true, ensure that a blank note cant be saved
field had to be set blank=true so that other forms on same page could be saved.
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_new_correct_software():
""" On creation of software note the software must be added """
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_view_software():
""" Ensure that if the user doesn't have view permissions for notes, they can't see any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_add_software():
""" Ensure that if the user doesn't have add permissions for notes, they can't add any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_edit_software():
""" Ensure that if the user doesn't have edit permissions for notes, they can't edit any notes
user must also have view permissions for the opject the note is for
"""
pass
@pytest.mark.skip(reason="to be written")
def test_note_auth_delete_software():
""" Ensure that if the user doesn't have delete permissions for notes, they can't delete any notes
user must also have view permissions for the opject the note is for
"""
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_software_auth_view(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_software_auth_add(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_software_auth_change(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_software_auth_delete(user):
""" Check correct permission for delete """
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_software_auth_view_api(user):
""" Check correct permission for view """
pass
@pytest.mark.skip(reason="to be written")
def test_software_auth_add_api(user):
""" Check correct permission for add """
pass
@pytest.mark.skip(reason="to be written")
def test_software_auth_change_api(user):
""" Check correct permission for change """
pass
@pytest.mark.skip(reason="to be written")
def test_software_auth_delete_api(user):
""" Check correct permission for delete """
pass