Adds ContactGroup.comments in the required locations

- [x] 1. Add the field to the model class
- [x] 2. Generate and run database migrations
- [NA] 3. Add validation logic to clean()
- [NA] 4. Update relevant querysets
- [x] 5. Update API serializer
- [x] 6. Add fields to forms
    - [x] tenancy.forms.model_forms, create/edit (e.g. model_forms.py)
    - [x] tenancy.forms.buld_edit, bulk edit
    - [x] tenancy.dorms.bulk_import, CSV import
    - [NA] filter (UI and API)
- [x] 7. Extend object filter set
- [x] 8. Add column to object table
- [x] 9. Update the SearchIndex
- [x] 10. Update the UI templates
- [x] 11. Create/extend test cases
    - [NA] models
    - [x] views
    - [NA] forms
    - [x] filtersets
    - [x] api
- [NA] 12. Update the model's documentation
This commit is contained in:
Jason Novinger
2025-03-11 10:42:59 -05:00
parent ed98756f3e
commit b8352260ee
11 changed files with 54 additions and 19 deletions

View File

@@ -107,13 +107,18 @@ class ContactGroupTest(APIViewTestCases.APIViewTestCase):
def setUpTestData(cls):
parent_contact_groups = (
ContactGroup.objects.create(name='Parent Contact Group 1', slug='parent-contact-group-1'),
ContactGroup.objects.create(
name='Parent Contact Group 1', slug='parent-contact-group-1', comments='Parent 1 comment'
),
ContactGroup.objects.create(name='Parent Contact Group 2', slug='parent-contact-group-2'),
)
ContactGroup.objects.create(name='Contact Group 1', slug='contact-group-1', parent=parent_contact_groups[0])
ContactGroup.objects.create(name='Contact Group 2', slug='contact-group-2', parent=parent_contact_groups[0])
ContactGroup.objects.create(name='Contact Group 3', slug='contact-group-3', parent=parent_contact_groups[0])
ContactGroup.objects.create(
name='Contact Group 3', slug='contact-group-3', parent=parent_contact_groups[0],
comments='Child Group 3 comment',
)
cls.create_data = [
{
@@ -125,11 +130,13 @@ class ContactGroupTest(APIViewTestCases.APIViewTestCase):
'name': 'Contact Group 5',
'slug': 'contact-group-5',
'parent': parent_contact_groups[1].pk,
'comments': '',
},
{
'name': 'Contact Group 6',
'slug': 'contact-group-6',
'parent': parent_contact_groups[1].pk,
'comments': 'Child Group 6 comment',
},
]