Skip to content

Commit

Permalink
Upgrade to the newer django-app-helper package
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiky30 committed Aug 5, 2021
1 parent c90a68a commit 37e19f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test_requirements/requirements_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sphinx==1.8.5
sphinxcontrib-spelling<7.0.0 # restriction for py35 tests
pyflakes>=2.1
# required to run the server for integration tests
djangocms-helper
django-app-helper
mock>=2.0.0
django-formtools
mysqlclient==2.0.3
9 changes: 5 additions & 4 deletions testserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,26 @@ def update(self, whatever):

def _helper_patch(*args, **kwargs):
from django.core.management import call_command
from djangocms_helper import utils
from app_helper import utils

call_command('migrate', run_syncdb=True)
utils.create_user('normal', 'normal@normal.normal', 'normal', is_staff=True, base_cms_permissions=True,
permissions=['view_page'])


def run():
from djangocms_helper import runner
from djangocms_helper import utils
from app_helper import runner
from app_helper import utils

os.environ.setdefault('DATABASE_URL', 'sqlite://localhost/testdb.sqlite')

# Patch djangocms_helper to create tables
# Patch app_helper to create tables
utils._create_db = _helper_patch

# we use '.runner()', not '.cms()' nor '.run()' because it does not
# add 'test' argument implicitly
runner.runner([sys.argv[0], 'cms', '--cms', 'server', '--bind', '0.0.0.0', '--port', str(port)])


if __name__ == "__main__":
run()

0 comments on commit 37e19f9

Please sign in to comment.