|
|
@@ -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",
|
|
|
}
|
|
|
|
|
|
|