|
17 | 17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
18 | 18 |
|
19 | 19 | from unittest import TestCase |
| 20 | +from uuid import uuid4 |
20 | 21 | from iris import Iris |
21 | 22 |
|
22 | 23 |
|
@@ -169,6 +170,11 @@ def test_get_case_should_have_field_case_name(self): |
169 | 170 | response = self._subject.get(f'/api/v2/cases/{case_identifier}').json() |
170 | 171 | self.assertIn('case_name', response) |
171 | 172 |
|
| 173 | + def test_get_case_should_have_field_case_customer_id(self): |
| 174 | + case_identifier = self._subject.create_dummy_case() |
| 175 | + response = self._subject.get(f'/api/v2/cases/{case_identifier}').json() |
| 176 | + self.assertIn('case_customer_id', response) |
| 177 | + |
172 | 178 | def test_create_case_should_return_data_with_case_customer_when_case_customer_is_an_empty_string(self): |
173 | 179 | body = { |
174 | 180 | 'case_name': 'case name', |
@@ -209,3 +215,10 @@ def test_update_case_should_allow_to_update_status(self): |
209 | 215 | identifier = self._subject.create_dummy_case() |
210 | 216 | response = self._subject.update(f'/api/v2/cases/{identifier}', { 'status_id': 2 }).json() |
211 | 217 | self.assertEqual(2, response['status_id']) |
| 218 | + |
| 219 | + def test_update_case_should_allow_to_update_customer(self): |
| 220 | + identifier = self._subject.create_dummy_case() |
| 221 | + response = self._subject.create('/manage/customers/add', { 'customer_name': f'customer{uuid4()}'}).json() |
| 222 | + customer_identifier = response['data']['customer_id'] |
| 223 | + response = self._subject.update(f'/api/v2/cases/{identifier}', {'case_customer': customer_identifier}).json() |
| 224 | + self.assertEqual(customer_identifier, response['case_customer_id']) |
0 commit comments