1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Standardize add, import, and export functionality for tags

This commit is contained in:
Jeremy Stretch
2020-06-12 09:48:23 -04:00
parent 057a022205
commit da906f48d9
7 changed files with 58 additions and 25 deletions

View File

@@ -10,16 +10,7 @@ from extras.models import ConfigContext, ObjectChange, Tag
from utilities.testing import ViewTestCases, TestCase
# TODO: Change base class to PrimaryObjectViewTestCase
# Blocked by #3703
class TagTestCase(
ViewTestCases.GetObjectViewTestCase,
ViewTestCases.EditObjectViewTestCase,
ViewTestCases.DeleteObjectViewTestCase,
ViewTestCases.ListObjectsViewTestCase,
ViewTestCases.BulkEditObjectsViewTestCase,
ViewTestCases.BulkDeleteObjectsViewTestCase
):
class TagTestCase(ViewTestCases.PrimaryObjectViewTestCase):
model = Tag
@classmethod
@@ -38,6 +29,13 @@ class TagTestCase(
'comments': 'Some comments',
}
cls.csv_data = (
"name,slug,color,description",
"Tag 4,tag-4,ff0000,Fourth tag",
"Tag 5,tag-5,00ff00,Fifth tag",
"Tag 6,tag-6,0000ff,Sixth tag",
)
cls.bulk_edit_data = {
'color': '00ff00',
}