Skip to content

Commit afbbdcc

Browse files
committed
Add tests for case field in Request model
- Test that case field defaults to False - Test that case field can be set to True - Ensures new field works as expected
1 parent 40a5fdb commit afbbdcc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/crm/test_request_methods.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,25 @@ def test_clean_method(self):
229229
self.contact_request.clean()
230230
self.contact_request.lead = None
231231

232+
def test_case_field_default(self):
233+
"""Test that the case field defaults to False."""
234+
request = Request(
235+
request_for='test inquiry',
236+
first_name='John',
237+
email='john@example.com'
238+
)
239+
self.assertFalse(request.case, "Case field should default to False")
240+
241+
def test_case_field_assignment(self):
242+
"""Test that the case field can be set to True."""
243+
request = Request(
244+
request_for='test case inquiry',
245+
first_name='Jane',
246+
email='jane@example.com',
247+
case=True
248+
)
249+
self.assertTrue(request.case, "Case field should be settable to True")
250+
232251

233252
def populate_db(cls):
234253
cls.owner = USER_MODEL.objects.get(username="Andrew.Manager.Global")

0 commit comments

Comments
 (0)