mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Another test
This commit is contained in:
parent
6f8c3454f3
commit
891f4f9f17
@ -159,7 +159,15 @@ class StockItemTest(StockViewTestCase):
|
||||
data = json.loads(response.content)
|
||||
self.assertTrue(data['form_valid'])
|
||||
|
||||
# Try again to serialize with the same numbers
|
||||
response = self.client.post(url, data_valid, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
data = json.loads(response.content)
|
||||
self.assertFalse(data['form_valid'])
|
||||
|
||||
# POST with invalid data
|
||||
response = self.client.post(url, data_invalid, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
data = json.loads(response.content)
|
||||
self.assertFalse(data['form_valid'])
|
||||
|
||||
|
@ -518,7 +518,7 @@ class StockItemSerialize(AjaxUpdateView):
|
||||
messages = e.message_dict
|
||||
|
||||
for k in messages.keys():
|
||||
if k in ['quantity', 'destionation', 'serial_numbers']:
|
||||
if k in ['quantity', 'destination', 'serial_numbers']:
|
||||
form.errors[k] = messages[k]
|
||||
else:
|
||||
form.non_field_errors = messages[k]
|
||||
|
Loading…
Reference in New Issue
Block a user