mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
test instance name
This commit is contained in:
parent
44fb356a3b
commit
00637f4b6c
@ -1,4 +1,5 @@
|
||||
|
||||
import imp
|
||||
import json
|
||||
from test.support import EnvironmentVarGuard
|
||||
|
||||
@ -25,6 +26,7 @@ import InvenTree.tasks
|
||||
|
||||
from stock.models import StockLocation
|
||||
from common.settings import currency_codes
|
||||
from common.models import InvenTreeSetting
|
||||
|
||||
|
||||
class ValidatorTest(TestCase):
|
||||
@ -482,3 +484,26 @@ class TestSettings(TestCase):
|
||||
with self.env:
|
||||
self.env.set(TEST_ENV_NAME, '321')
|
||||
self.assertEqual(get_setting(TEST_ENV_NAME, None), '321')
|
||||
|
||||
class TestInstanceName(TestCase):
|
||||
"""
|
||||
Unit tests for instance name
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
# Create a user for auth
|
||||
user = get_user_model()
|
||||
self.user = user.objects.create_superuser('testuser', 'test@testing.com', 'password')
|
||||
|
||||
self.client.login(username='testuser', password='password')
|
||||
|
||||
def test_instance_name(self):
|
||||
|
||||
# default setting
|
||||
self.assertEqual(version.inventreeInstanceTitle(), 'InvenTree')
|
||||
|
||||
# set up required setting
|
||||
InvenTreeSetting.set_setting("INVENTREE_INSTANCE_TITLE", True, self.user)
|
||||
InvenTreeSetting.set_setting("INVENTREE_INSTANCE", "Testing title", self.user)
|
||||
|
||||
self.assertEqual(version.inventreeInstanceTitle(), 'Testing title')
|
||||
|
Loading…
Reference in New Issue
Block a user