Update unit tests to match new docker paths (#3360)

* Update unit tests to match new docker paths

Ref: https://github.com/inventree/InvenTree/pull/3357

* Add "wait" step before running dev server
This commit is contained in:
Oliver 2022-07-20 11:44:25 +10:00 committed by GitHub
parent 5bb76a3730
commit e383d6e955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -691,7 +691,7 @@ class TestSettings(helpers.InvenTreeTestCase):
valid = [
'inventree/config.yaml',
'inventree/dev/config.yaml',
'inventree/data/config.yaml',
]
self.assertTrue(any([opt in config.get_config_file().lower() for opt in valid]))
@ -706,7 +706,7 @@ class TestSettings(helpers.InvenTreeTestCase):
valid = [
'inventree/plugins.txt',
'inventree/dev/plugins.txt',
'inventree/data/plugins.txt',
]
self.assertTrue(any([opt in config.get_plugin_file().lower() for opt in valid]))

View File

@ -406,7 +406,13 @@ def import_fixtures(c):
# Execution tasks
@task(help={'address': 'Server address:port (default=127.0.0.1:8000)'})
@task
def wait(c):
"""Wait until the database connection is ready."""
return manage(c, "wait_for_db")
@task(pre=[wait], help={'address': 'Server address:port (default=127.0.0.1:8000)'})
def server(c, address="127.0.0.1:8000"):
"""Launch a (deveopment) server using Django's in-built webserver.
@ -415,12 +421,6 @@ def server(c, address="127.0.0.1:8000"):
manage(c, "runserver {address}".format(address=address), pty=True)
@task
def wait(c):
"""Wait until the database connection is ready."""
return manage(c, "wait_for_db")
@task(pre=[wait])
def worker(c):
"""Run the InvenTree background worker process."""