mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
(partial) tests for attachment forms
This commit is contained in:
parent
3a9494ee69
commit
afcd411358
@ -83,9 +83,26 @@ class PartEditTest(PartViewTestCase):
|
|||||||
self.assertIn('html_form', data)
|
self.assertIn('html_form', data)
|
||||||
self.assertIn('"title":', data)
|
self.assertIn('"title":', data)
|
||||||
|
|
||||||
def test_invalid_part(self):
|
|
||||||
response = self.client.get(reverse('part-edit', args=(9999,)), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
class PartAttachmentTests(PartViewTestCase):
|
||||||
self.assertEqual(response.status_code, 404)
|
|
||||||
|
def test_valid_create(self):
|
||||||
|
""" test creation of an attachment for a valid part """
|
||||||
|
|
||||||
|
response = self.client.get(reverse('part-attachment-create'), {'part': 1}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
def test_invalid_create(self):
|
||||||
|
""" test creation of an attachment for an invalid part """
|
||||||
|
|
||||||
|
with self.assertRaises(Part.DoesNotExist):
|
||||||
|
response = self.client.get(reverse('part-attachment-create'), {'part': 999}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||||
|
|
||||||
|
def test_edit(self):
|
||||||
|
""" test editing an attachment """
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class PartQRTest(PartViewTestCase):
|
class PartQRTest(PartViewTestCase):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user