Skip to content

Commit bfe14ca

Browse files
committed
Added test to update case_customer identifier
1 parent 2b461dd commit bfe14ca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/tests_rest_cases.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1818

1919
from unittest import TestCase
20+
from uuid import uuid4
2021
from iris import Iris
2122

2223

@@ -169,6 +170,11 @@ def test_get_case_should_have_field_case_name(self):
169170
response = self._subject.get(f'/api/v2/cases/{case_identifier}').json()
170171
self.assertIn('case_name', response)
171172

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+
172178
def test_create_case_should_return_data_with_case_customer_when_case_customer_is_an_empty_string(self):
173179
body = {
174180
'case_name': 'case name',
@@ -209,3 +215,10 @@ def test_update_case_should_allow_to_update_status(self):
209215
identifier = self._subject.create_dummy_case()
210216
response = self._subject.update(f'/api/v2/cases/{identifier}', { 'status_id': 2 }).json()
211217
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

Comments
 (0)