I am trying to run python manage.py test
and it starts off with the usual Creating test database for alias 'default'...
but then a pymysql.err.InternalError
occurs with the message "Invalid default value for 'expiration_time'"
. expiration_time is a timestamp variable with the default value as null. One reason that I can think of why this error is occuring is probably because all migrations are being re-run and that this might not be an acceptable default value but I could not find any information on how the test db is actually created by django.
Asked
Active
Viewed 1,574 times
0

Projjol
- 1,195
- 2
- 12
- 26
-
And this error didnt occur when you ran `migrate` command for your server database? – Sachin Aug 01 '18 at 17:42
-
did you tried this package, ? https://pypi.org/project/django-test-without-migrations/ – JPG Aug 01 '18 at 17:46
-
Can you add the model ? – Sachin Aug 01 '18 at 17:49
-
@SachinKukreja I'm working on a project started by someone else so unfortunately there are no models. View files access db via custom libs and update the db directly. – Projjol Aug 02 '18 at 14:00
-
@JerinPeterGeorge not yet, thanks for pointing it out will try it – Projjol Aug 02 '18 at 14:04
-
https://simpleisbetterthancomplex.com/tips/2016/08/19/django-tip-12-disabling-migrations-to-speed-up-unit-tests.html – Sachin Aug 02 '18 at 15:02