Commit e5f0e509 by Clinton Blackburn

Added support for disabling migrations when testing

Migrations require up to two minutes to run. This drastically slows down development. The option to disable migrations when testing has been restored.
parent d66379b9
...@@ -7,6 +7,13 @@ To run the unit test suite followed by quality checks, run: ...@@ -7,6 +7,13 @@ To run the unit test suite followed by quality checks, run:
$ make validate $ make validate
The unit tests run database migrations by default. These migrations can take up to two minutes to run. Most local development
won't require migrations. You can save time by disabling migrations when running tests locally with the command below:
.. code-block:: bash
$ DISABLE_MIGRATIONS=1 make validate
Code quality validation can be performed independently with: Code quality validation can be performed independently with:
.. code-block:: bash .. code-block:: bash
......
...@@ -13,6 +13,19 @@ INSTALLED_APPS += ( ...@@ -13,6 +13,19 @@ INSTALLED_APPS += (
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
LOGGING = get_logger_config(debug=DEBUG, dev_env=True, local_loglevel='DEBUG') LOGGING = get_logger_config(debug=DEBUG, dev_env=True, local_loglevel='DEBUG')
if os.getenv('DISABLE_MIGRATIONS'):
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
# END TEST SETTINGS # END TEST SETTINGS
...@@ -53,6 +66,10 @@ JWT_AUTH.update({ ...@@ -53,6 +66,10 @@ JWT_AUTH.update({
'JWT_SECRET_KEY': 'insecure-secret-key', 'JWT_SECRET_KEY': 'insecure-secret-key',
'JWT_ISSUERS': ('test-issuer',), 'JWT_ISSUERS': ('test-issuer',),
}) })
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
# END AUTHENTICATION # END AUTHENTICATION
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment