mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-19 01:58:43 -06:00
17170 Add ability to add contacts to multiple contact groups (#18885)
* 17170 Allow multiple Group assignments for Contacts * 17170 update docs * 17170 update api, detail view, graphql * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fixes * 17170 fix bulk import * 17170 test fixes * 17170 test fixes * 17170 test fixes * 17178 review changes * 17178 review changes * 17178 review changes * 17178 review changes * 17178 review changes * 17178 review changes * 17170 update migration * 17170 bulk edit form
This commit is contained in:
@@ -196,37 +196,40 @@ class ContactTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
contactgroup.save()
|
||||
|
||||
contacts = (
|
||||
Contact(name='Contact 1', group=contact_groups[0]),
|
||||
Contact(name='Contact 2', group=contact_groups[0]),
|
||||
Contact(name='Contact 3', group=contact_groups[0]),
|
||||
Contact(name='Contact 1'),
|
||||
Contact(name='Contact 2'),
|
||||
Contact(name='Contact 3'),
|
||||
)
|
||||
Contact.objects.bulk_create(contacts)
|
||||
contacts[0].groups.add(contact_groups[0])
|
||||
contacts[1].groups.add(contact_groups[1])
|
||||
|
||||
tags = create_tags('Alpha', 'Bravo', 'Charlie')
|
||||
|
||||
cls.form_data = {
|
||||
'name': 'Contact X',
|
||||
'group': contact_groups[1].pk,
|
||||
'groups': [contact_groups[1].pk],
|
||||
'comments': 'Some comments',
|
||||
'tags': [t.pk for t in tags],
|
||||
}
|
||||
|
||||
cls.csv_data = (
|
||||
"group,name",
|
||||
"Contact Group 1,Contact 4",
|
||||
"Contact Group 1,Contact 5",
|
||||
"Contact Group 1,Contact 6",
|
||||
"name",
|
||||
"groups",
|
||||
"Contact 4",
|
||||
"Contact 5",
|
||||
"Contact 6",
|
||||
)
|
||||
|
||||
cls.csv_update_data = (
|
||||
"id,name,comments",
|
||||
f"{contacts[0].pk},Contact Group 7,New comments 7",
|
||||
f"{contacts[1].pk},Contact Group 8,New comments 8",
|
||||
f"{contacts[2].pk},Contact Group 9,New comments 9",
|
||||
"id,name,groups,comments",
|
||||
f'{contacts[0].pk},Contact 7,"Contact Group 1,Contact Group 2",New comments 7',
|
||||
f'{contacts[1].pk},Contact 8,"Contact Group 1",New comments 8',
|
||||
f'{contacts[2].pk},Contact 9,"Contact Group 1",New comments 9',
|
||||
)
|
||||
|
||||
cls.bulk_edit_data = {
|
||||
'group': contact_groups[1].pk,
|
||||
'description': "New description",
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user