mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 03:55:41 +00:00
fix assertations
This commit is contained in:
@ -32,16 +32,13 @@ class MiddlewareTests(InvenTreeTestCase):
|
|||||||
# logout
|
# logout
|
||||||
self.client.logout()
|
self.client.logout()
|
||||||
|
|
||||||
# check that account things go through
|
# check that account things are rereouted
|
||||||
self.check_path(reverse('account_login'))
|
self.check_path(reverse('account_login'), 302)
|
||||||
|
|
||||||
# check that frontend code is redirected to login
|
# check that frontend code is redirected to login
|
||||||
response = self.check_path(reverse('stats'), 302)
|
response = self.check_path(reverse('stats'), 302)
|
||||||
self.assertEqual(response.url, '/accounts/login/?next=/stats/')
|
self.assertEqual(response.url, '/accounts/login/?next=/stats/')
|
||||||
|
|
||||||
# check that a 401 is raised
|
|
||||||
self.check_path(reverse('settings.js'), 401)
|
|
||||||
|
|
||||||
def test_token_auth(self):
|
def test_token_auth(self):
|
||||||
"""Test auth with token auth."""
|
"""Test auth with token auth."""
|
||||||
# get token
|
# get token
|
||||||
|
@ -49,4 +49,4 @@ class ViewTests(InvenTreeTestCase):
|
|||||||
f'/accounts/login/?next=/&login={self.username}&password={self.password}'
|
f'/accounts/login/?next=/&login={self.username}&password={self.password}'
|
||||||
)
|
)
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
self.assertEqual(response.url, '/')
|
self.assertEqual(response.url, '/platform')
|
||||||
|
@ -44,7 +44,7 @@ class BuildTestSimple(InvenTreeTestCase):
|
|||||||
def test_url(self):
|
def test_url(self):
|
||||||
"""Test URL lookup"""
|
"""Test URL lookup"""
|
||||||
b1 = Build.objects.get(pk=1)
|
b1 = Build.objects.get(pk=1)
|
||||||
self.assertEqual(b1.get_absolute_url(), 'TOBEREFACTORED')
|
self.assertEqual(b1.get_absolute_url(), '/platform/manufacturing/build-order/1')
|
||||||
|
|
||||||
def test_is_complete(self):
|
def test_is_complete(self):
|
||||||
"""Test build completion status"""
|
"""Test build completion status"""
|
||||||
|
Reference in New Issue
Block a user