-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add Test case abstract classes to models
- Loading branch information
Showing
25 changed files
with
814 additions
and
2 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
app/access/tests/unit/organization/test_organization_views.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
import unittest | ||
import requests | ||
|
||
from django.test import TestCase | ||
|
||
from app.tests.abstract.models import ModelDisplay, ModelIndex | ||
|
||
|
||
|
||
class OrganizationViews( | ||
TestCase, | ||
ModelDisplay, | ||
ModelIndex | ||
): | ||
|
||
display_module = 'access.views.organization' | ||
display_view = 'View' | ||
|
||
index_module = display_module | ||
index_view = 'IndexView' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
import unittest | ||
import requests | ||
|
||
from django.test import TestCase | ||
|
||
from app.tests.abstract.models import ModelAdd, ModelDelete, ModelDisplay | ||
|
||
|
||
|
||
class TeamViews( | ||
TestCase, | ||
ModelAdd, | ||
ModelDelete, | ||
ModelDisplay, | ||
): | ||
|
||
add_module = 'access.views.team' | ||
add_view = 'Add' | ||
|
||
# change_module = add_module | ||
# change_view = 'Change' | ||
|
||
delete_module = add_module | ||
delete_view = 'Delete' | ||
|
||
display_module = add_module | ||
display_view = 'View' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
import unittest | ||
import requests | ||
|
||
from django.test import TestCase | ||
|
||
from app.tests.abstract.models import AddView, DeleteView | ||
|
||
|
||
|
||
class TeamUserViews( | ||
TestCase, | ||
AddView, | ||
DeleteView | ||
): | ||
|
||
add_module = 'access.views.user' | ||
add_view = 'Add' | ||
|
||
# change_module = add_module | ||
# change_view = 'GroupView' | ||
|
||
delete_module = add_module | ||
delete_view = 'Delete' | ||
|
||
# display_module = add_module | ||
# display_view = 'GroupView' | ||
|
||
# index_module = add_module | ||
# index_view = 'GroupIndexView' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import pytest | ||
import unittest | ||
|
||
from app.tests.abstract.views import AddView, ChangeView, DeleteView, DisplayView, IndexView | ||
|
||
class ModelAdd( | ||
AddView | ||
): | ||
""" Unit Tests for Model Add """ | ||
|
||
|
||
|
||
class ModelChange( | ||
ChangeView | ||
): | ||
""" Unit Tests for Model Change """ | ||
|
||
|
||
|
||
class ModelDelete( | ||
DeleteView | ||
): | ||
""" Unit Tests for Model delete """ | ||
|
||
|
||
|
||
class ModelDisplay( | ||
DisplayView | ||
): | ||
""" Unit Tests for Model display """ | ||
|
||
|
||
|
||
class ModelIndex( | ||
IndexView | ||
): | ||
""" Unit Tests for Model index """ | ||
|
||
|
||
|
||
class ModelCommon( | ||
ModelAdd, | ||
ModelChange, | ||
ModelDelete, | ||
ModelDisplay | ||
): | ||
""" Unit Tests for all models """ | ||
|
||
|
||
|
||
class PrimaryModel( | ||
ModelCommon, | ||
ModelIndex | ||
): | ||
""" Tests for Primary Models | ||
A Primary model is a model that is deemed a model that has the following views: | ||
- Add | ||
- Change | ||
- Delete | ||
- Display | ||
- Index | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import pytest | ||
import unittest | ||
|
||
|
||
|
||
class AddView: | ||
""" Testing of Display view """ | ||
|
||
add_module: str = None | ||
""" Full module path to test """ | ||
|
||
add_view: str = None | ||
""" View Class name to test """ | ||
|
||
|
||
|
||
class ChangeView: | ||
""" Testing of Display view """ | ||
|
||
change_module: str = None | ||
""" Full module path to test """ | ||
|
||
change_view: str = None | ||
""" Change Class name to test """ | ||
|
||
|
||
|
||
class DeleteView: | ||
""" Testing of Display view """ | ||
|
||
delete_module: str = None | ||
""" Full module path to test """ | ||
|
||
delete_view: str = None | ||
""" Delete Class name to test """ | ||
|
||
|
||
|
||
class DisplayView: | ||
""" Testing of Display view """ | ||
|
||
display_module: str = None | ||
""" Full module path to test """ | ||
|
||
display_view: str = None | ||
""" Change Class name to test """ | ||
|
||
|
||
|
||
class IndexView: | ||
""" Testing of Display view """ | ||
|
||
index_module: str = None | ||
""" Full module path to test """ | ||
|
||
index_view: str = None | ||
""" Index Class name to test """ | ||
|
||
|
||
|
||
class AllViews( | ||
AddView, | ||
ChangeView, | ||
DeleteView, | ||
DisplayView, | ||
IndexView | ||
): | ||
""" Abstract test class containing ALL view tests """ | ||
|
||
add_module: str = None | ||
""" Full module path to test """ | ||
|
||
add_view: str = None | ||
""" View Class name to test """ | ||
|
||
change_module: str = None | ||
""" Full module path to test """ | ||
|
||
change_view: str = None | ||
""" Change Class name to test """ | ||
|
||
delete_module: str = None | ||
""" Full module path to test """ | ||
|
||
delete_view: str = None | ||
""" Delete Class name to test """ | ||
|
||
display_module: str = None | ||
""" Full module path to test """ | ||
|
||
display_view: str = None | ||
""" Change Class name to test """ | ||
|
||
index_module: str = None | ||
""" Full module path to test """ | ||
|
||
index_view: str = None | ||
""" Index Class name to test """ | ||
|
29 changes: 29 additions & 0 deletions
29
app/config_management/tests/unit/config_groups/test_config_management_views.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
import unittest | ||
import requests | ||
|
||
from django.test import TestCase | ||
|
||
from app.tests.abstract.models import PrimaryModel | ||
|
||
|
||
|
||
class ConfigManagementViews( | ||
TestCase, | ||
PrimaryModel | ||
): | ||
|
||
add_module = 'config_management.views.groups.groups' | ||
add_view = 'GroupAdd' | ||
|
||
change_module = add_module | ||
change_view = 'GroupView' | ||
|
||
delete_module = add_module | ||
delete_view = 'GroupDelete' | ||
|
||
display_module = add_module | ||
display_view = 'GroupView' | ||
|
||
index_module = add_module | ||
index_view = 'GroupIndexView' |
31 changes: 31 additions & 0 deletions
31
app/config_management/tests/unit/config_groups_software/test_config_groups_software_views.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pytest | ||
import unittest | ||
import requests | ||
|
||
from django.test import TestCase | ||
|
||
from app.tests.abstract.models import AddView, ChangeView, DeleteView | ||
|
||
|
||
|
||
class ConfigGroupsSoftwareViews( | ||
TestCase, | ||
AddView, | ||
ChangeView, | ||
DeleteView | ||
): | ||
|
||
add_module = 'config_management.views.groups.software' | ||
add_view = 'GroupSoftwareAdd' | ||
|
||
change_module = add_module | ||
change_view = 'GroupSoftwareChange' | ||
|
||
delete_module = add_module | ||
delete_view = 'GroupSoftwareDelete' | ||
|
||
# display_module = add_module | ||
# display_view = 'GroupView' | ||
|
||
# index_module = add_module | ||
# index_view = 'GroupIndexView' |
29 changes: 29 additions & 0 deletions
29
app/core/tests/unit/manufacturer/test_manufacturer_views.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
import unittest | ||
import requests | ||
|
||
from django.test import TestCase | ||
|
||
from app.tests.abstract.models import PrimaryModel | ||
|
||
|
||
|
||
class ManufacturerViews( | ||
TestCase, | ||
PrimaryModel | ||
): | ||
|
||
add_module = 'settings.views.manufacturer' | ||
add_view = 'Add' | ||
|
||
change_module = add_module | ||
change_view = 'View' | ||
|
||
delete_module = add_module | ||
delete_view = 'Delete' | ||
|
||
display_module = add_module | ||
display_view = 'View' | ||
|
||
index_module = add_module | ||
index_view = 'Index' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pytest | ||
import unittest | ||
import requests | ||
|
||
from django.test import TestCase | ||
|
||
from app.tests.abstract.models import ModelDisplay | ||
|
||
|
||
|
||
class HistoryViews( | ||
TestCase, | ||
ModelDisplay | ||
): | ||
|
||
# add_module = 'config_management.views.groups.groups' | ||
# add_view = 'GroupAdd' | ||
|
||
# change_module = add_module | ||
# change_view = 'GroupView' | ||
|
||
# delete_module = add_module | ||
# delete_view = 'GroupDelete' | ||
|
||
display_module = 'core.views.history' | ||
display_view = 'View' | ||
|
||
# index_module = add_module | ||
# index_view = 'GroupIndexView' | ||
|
||
@pytest.mark.skip(reason="test this models dynamic build of self.model") | ||
def test_view_display_attribute_exists_model(self): | ||
""" As part of display init this view dynamically builds self.model """ | ||
|
||
pass |
Oops, something went wrong.