mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Some more unit tests
This commit is contained in:
parent
561cc7a1dd
commit
bd653f2c49
@ -198,6 +198,23 @@ class CategoryTest(PartViewTestCase):
|
|||||||
response = self.client.get(reverse('category-edit', args=(1,)), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
response = self.client.get(reverse('category-edit', args=(1,)), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
def test_set_category(self):
|
||||||
|
""" Test that the "SetCategory" view works """
|
||||||
|
|
||||||
|
url = reverse('part-set-category')
|
||||||
|
|
||||||
|
response = self.client.get(url, {'parts[]': 1}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
data = {
|
||||||
|
'part_id_10': True,
|
||||||
|
'part_id_1': True,
|
||||||
|
'part_category': 5
|
||||||
|
}
|
||||||
|
|
||||||
|
response = self.client.post(url, data, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
|
|
||||||
class BomItemTests(PartViewTestCase):
|
class BomItemTests(PartViewTestCase):
|
||||||
""" Tests for BomItem related views """
|
""" Tests for BomItem related views """
|
||||||
|
Loading…
Reference in New Issue
Block a user