2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 18:15:40 +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

View File

@ -174,37 +174,16 @@ def style(c):
print("Running PEP style checks...")
c.run('flake8 InvenTree')
@task(help={'database': "Database framework to use (default=sqlite)"})
@task
def test(c, database=None):
"""
Run unit-tests for InvenTree codebase.
"""
if database is None:
database = 'sqlite'
database = database.lower()
allowed = {
'sqlite': 'InvenTree.settings',
'postgresql': 'InvenTree.ci_postgresql',
'mysql': 'InvenTree.ci_mysql',
}
if database not in allowed.keys():
print("Database framework not supported for testing:")
print("Choose from: '{a}'".format(a=allowed))
return False
# Run sanity check on the django install
manage(c, 'check')
# Run coverage tests
manage(c, 'test {apps} --settings={sett}'.format(
apps=' '.join(apps()),
sett=allowed[database]
))
manage(c, 'test', pty=True)
@task
def coverage(c):