Merge pull request #613 from SchrodingersGat/more-unit-testing

Some more unit tests
This commit is contained in:
Oliver 2020-01-07 21:22:00 +11:00 committed by GitHub
commit 8275271ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,6 +198,23 @@ class CategoryTest(PartViewTestCase):
response = self.client.get(reverse('category-edit', args=(1,)), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
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):
""" Tests for BomItem related views """