2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-23 09:35:30 +00:00

Update test fixtures

- Can't assume that pk values will be assigned sensibly!
- Need to hard-code them in
This commit is contained in:
Oliver Walters
2020-09-02 19:47:07 +10:00
parent bc2f131144
commit 911727f7b7
15 changed files with 85 additions and 57 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ class StockAPITestCase(APITestCase):
def setUp(self):
# Create a user for auth
User = get_user_model()
User.objects.create_user('testuser', 'test@testing.com', 'password')
self.user = User.objects.create_user('testuser', 'test@testing.com', 'password')
self.client.login(username='testuser', password='password')
def doPost(self, url, data={}):
@@ -308,4 +308,4 @@ class StockTestResultTest(StockAPITestCase):
test = response.data[0]
self.assertEqual(test['value'], '150kPa')
self.assertEqual(test['user'], 1)
self.assertEqual(test['user'], self.user.pk)