Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 580, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.UndefinedTable: relation "organizations" does not exist
LINE 2: FROM organizations
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.7/site-packages/werkzeug/middleware/proxy_fix.py", line 232, in __call__
return self.app(environ, start_response)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
return original_handler(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
return original_handler(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.7/site-packages/flask_limiter/extension.py", line 442, in __inner
return obj(*a, **k)
File "/app/redash/handlers/authentication.py", line 190, in login
if current_org == None and not settings.MULTI_ORG:
File "/usr/local/lib/python3.7/site-packages/werkzeug/local.py", line 370, in <lambda>
__eq__ = lambda x, o: x._get_current_object() == o
File "/usr/local/lib/python3.7/site-packages/werkzeug/local.py", line 307, in _get_current_object
return self.__local()
File "/app/redash/authentication/org_resolving.py", line 18, in _get_current_org
g.org = Organization.get_by_slug(slug)
File "/app/redash/models/organizations.py", line 31, in get_by_slug
return cls.query.filter(cls.slug == slug).first()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3240, in first
ret = list(self[0:1])
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3018, in __getitem__
return list(res)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3342, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3367, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
distilled_params,
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1253, in _execute_context
e, statement, parameters, cursor, context
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1473, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 580, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "organizations" does not exist
LINE 2: FROM organizations
^
[SQL: SELECT organizations.updated_at AS organizations_updated_at, organizations.created_at AS organizations_created_at, organizations.id AS organizations_id, organizations.name AS organizations_name, organizations.slug AS organizations_slug, organizations.settings AS organizations_settings
FROM organizations
WHERE organizations.slug = %(slug_1)s
LIMIT %(param_1)s]
[parameters: {'slug_1': 'default', 'param_1': 1}]
(Background on this error at: http://sqlalche.me/e/f405)
Technical details:
- Redash Version: e9bcc3c
- How did you install Redash: docker-compose up —build (+ some dep fixes, otherwise it would not start)
Issue
I tried to start using Postgresql instead of sqlite in my Django project.
I installed postgreqL ON MY Windows, creatred a new database, user and password.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'database_name',
'USER': 'admin',
'PASSWORD': 'admin',
'HOST': 'localhost',
'PORT': '5432',
}
}
But when I try to migrate or makemigrations, I got this:
File
«C:Userss…venvlibsite-packagesdjangodbbackendsutils.py»,
line 85, in _execute
return self.cursor.execute(sql, params) psycopg2.errors.UndefinedTable: relation «authentication_author» does
not exist LINE 1: …hentication_author».»is_doctor» FROM
«authentic…
here is my model:
class Author(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, related_name="author")
slug = models.CharField(max_length=50, null=True, blank=True,)
is_doctor = models.BooleanField(default=False)
And yes, I deleted the sqlite3 database, all the migrations folders and I created new ones with the init.py inside of them.
But still get the same problem.
Updated
Traceback screenshots:


Solution
It happens with Django. Sometimes you can invoke some code that relies on a new DB schema at the time you’re trying to makemigrations.
All you need in this situation is to temporarily comment out all the code that connects makemigrations with your new model’s schema. As it was in this question, you can trace related blocks of code just using full traceback.
Answered By — Yevgeniy Kosmak
New in version 2.8.
Changed in version 2.8.4: added errors introduced in PostgreSQL 12
Changed in version 2.8.6: added errors introduced in PostgreSQL 13
Changed in version 2.9.2: added errors introduced in PostgreSQL 14
Changed in version 2.9.4: added errors introduced in PostgreSQL 15
This module exposes the classes psycopg raises upon receiving an error from
the database with a SQLSTATE value attached (available in the
pgcode attribute). The content of the module is generated
from the PostgreSQL source code and includes classes for every error defined
by PostgreSQL in versions between 9.1 and 15.
Every class in the module is named after what referred as “condition name” in
the documentation, converted to CamelCase: e.g. the error 22012,
division_by_zero is exposed by this module as the class DivisionByZero.
Every exception class is a subclass of one of the standard DB-API
exception and expose the Error interface.
Each class’ superclass is what used to be raised by psycopg in versions before
the introduction of this module, so everything should be compatible with
previously written code catching one the DB-API class: if your code used to
catch IntegrityError to detect a duplicate entry, it will keep on working
even if a more specialised subclass such as UniqueViolation is raised.
The new classes allow a more idiomatic way to check and process a specific
error among the many the database may return. For instance, in order to check
that a table is locked, the following code could have been used previously:
try: cur.execute("LOCK TABLE mytable IN ACCESS EXCLUSIVE MODE NOWAIT") except psycopg2.OperationalError as e: if e.pgcode == psycopg2.errorcodes.LOCK_NOT_AVAILABLE: locked = True else: raise
While this method is still available, the specialised class allows for a more
idiomatic error handler:
try: cur.execute("LOCK TABLE mytable IN ACCESS EXCLUSIVE MODE NOWAIT") except psycopg2.errors.LockNotAvailable: locked = True
- psycopg2.errors.lookup(code)¶
-
Lookup an error code and return its exception class.
Raise
KeyErrorif the code is not found.try: cur.execute("LOCK TABLE mytable IN ACCESS EXCLUSIVE MODE NOWAIT") except psycopg2.errors.lookup("55P03"): locked = True
SQLSTATE exception classes¶
The following table contains the list of all the SQLSTATE classes exposed by
the module.
Note that, for completeness, the module also exposes all the
DB-API-defined exceptions and a few
psycopg-specific ones exposed by the extensions
module, which are not listed here.
|
SQLSTATE |
Exception |
Base exception |
|---|---|---|
|
Class 02: No Data (this is also a warning class per the SQL standard) |
||
|
|
|
|
|
|
|
|
|
Class 03: SQL Statement Not Yet Complete |
||
|
|
|
|
|
Class 08: Connection Exception |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 09: Triggered Action Exception |
||
|
|
|
|
|
Class 0A: Feature Not Supported |
||
|
|
|
|
|
Class 0B: Invalid Transaction Initiation |
||
|
|
|
|
|
Class 0F: Locator Exception |
||
|
|
|
|
|
|
|
|
|
Class 0L: Invalid Grantor |
||
|
|
|
|
|
|
|
|
|
Class 0P: Invalid Role Specification |
||
|
|
|
|
|
Class 0Z: Diagnostics Exception |
||
|
|
|
|
|
|
|
|
|
Class 20: Case Not Found |
||
|
|
|
|
|
Class 21: Cardinality Violation |
||
|
|
|
|
|
Class 22: Data Exception |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 23: Integrity Constraint Violation |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 24: Invalid Cursor State |
||
|
|
|
|
|
Class 25: Invalid Transaction State |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 26: Invalid SQL Statement Name |
||
|
|
|
|
|
Class 27: Triggered Data Change Violation |
||
|
|
|
|
|
Class 28: Invalid Authorization Specification |
||
|
|
|
|
|
|
|
|
|
Class 2B: Dependent Privilege Descriptors Still Exist |
||
|
|
|
|
|
|
|
|
|
Class 2D: Invalid Transaction Termination |
||
|
|
|
|
|
Class 2F: SQL Routine Exception |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 34: Invalid Cursor Name |
||
|
|
|
|
|
Class 38: External Routine Exception |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 39: External Routine Invocation Exception |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 3B: Savepoint Exception |
||
|
|
|
|
|
|
|
|
|
Class 3D: Invalid Catalog Name |
||
|
|
|
|
|
Class 3F: Invalid Schema Name |
||
|
|
|
|
|
Class 40: Transaction Rollback |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 42: Syntax Error or Access Rule Violation |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 44: WITH CHECK OPTION Violation |
||
|
|
|
|
|
Class 53: Insufficient Resources |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 54: Program Limit Exceeded |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 55: Object Not In Prerequisite State |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 57: Operator Intervention |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 58: System Error (errors external to PostgreSQL itself) |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class 72: Snapshot Failure |
||
|
|
|
|
|
Class F0: Configuration File Error |
||
|
|
|
|
|
|
|
|
|
Class HV: Foreign Data Wrapper Error (SQL/MED) |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class P0: PL/pgSQL Error |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class XX: Internal Error |
||
|
|
|
|
|
|
|
|
|
|
|
|
In odoo 15, i got the issue after trying to create Many2many field in settings:
psycopg2.errors.UndefinedTable: relation «product_product_res_config_settings_rel» does not exist
My code:
from odoo import api, fields, models
from ast import literal_evalclass SchoolSettings(models.TransientModel):
_inherit = 'res.config.settings'product_default = fields.Many2many('product.product', string='Default Product')
@api.model
def get_values(self):
res = super(SchoolSettings, self).get_values()
if self.env['ir.config_parameter'].sudo().get_param('school.school_default_teacher'):
product_default = self.env['ir.config_parameter'].sudo().get_param('school.product_default')
res.update(
product_default=[(6, 0, literal_eval(product_default))]
)return res
def set_values(self):
super(SchoolSettings, self).set_values()
self.env['ir.config_parameter'].set_param('school.product_default', self.product_default.ids)Xml:
<div class="content-group">
<label string="Default Product" for="product_default"/>
<field name="product_default" widget="many2many_tags"/>
</div>
Please help, thanks.
3Answers
I’ve found the answer based on «Kiran K» answer:
from odoo import api, fields, models
from ast import literal_evalclass SchoolSettings(models.TransientModel):
_inherit = 'res.config.settings'# many2many will give you multiselect options, when many2one only give you select option
# to use many2many, we must declare the middle table to connect 2 tables together.
# in this example, i create a new table named 'config_product_rel'
# with 2 column connect 2 table that is 'id' for the 'ir_config_parameter' table
# and 'product_id' for 'product_product' table
product_default_many2many = fields.Many2many('product.product', 'config_product_rel', 'id', 'product_id',
'Default Product Many2many')@api.model
def get_values(self):
res = super(SchoolSettings, self).get_values()# set values for many2many field
if self.env['ir.config_parameter'].sudo().get_param('school.product_default_many2many'):
product_default_many2many = self.env['ir.config_parameter'].sudo().get_param('school.product_default_many2many')
res['product_default_many2many'] = [(6, 0, literal_eval(product_default_many2many))]return res
def set_values(self):
# get values for many2many field
self.env['ir.config_parameter'].set_param('school.product_default_many2many', self.product_default_many2many.ids)
Thanks.
class ResCompany(models.Model):
_inherit = 'res.company'def _active_products(self):
return self.env['product.product'].search([]).idsproduct_ids = fields.Many2many('product.product', 'company_product_rel', 'company_id', 'product_id',
'Default Product',default=_active_products)class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'product_ids = fields.Many2many(related='company_id.product_ids', relation='product.product', readonly=False)
Hope it helps,
Kiran K
Lo definí así y funciono.
classProductWizard(models.TransientModel):
_name = «product.wizard»
_description = «See all Products and warehause»
pricelist_ids = fields.Many2many(comodel_name=‘product.pricelist’, string=‘Pricelist’, required=True)
Я использую Travis для CI / CD как часть моего приложения Django с базой данных postgresql. (Джанго 2.1.4)
Сборка постоянно завершается неудачей на Travis, как только запускаются тесты. Я получаю эту ошибку:
psycopg2.errors.UndefinedTable: relation "auth_user" does not exist
Я пробовал: makemigrations, migrate auth, migrate myapp, migrate --run-syncdb. Все из которых терпят неудачу с той же ошибкой.
Тесты выполняются локально с базой данных sqlite3, а также в похожей на prod среде heroku с базой данных postgresql.
.travis.yml
...
before script:
-psql -c 'create database travis_ci_test;' -U postgres
services:
-postgresql
script:
-yes | python3 manage.py makemigrations
-python3 manage.py migrate auth
-python3 manage.py migrate --run-syncdb
-python3 manage.py tests test/unit_tests
Settings.py
...
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'travis_ci_test',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
}
}
...
INSTALLED_APPS = [...
'django.contrib.auth',
]
Вот результат неудачной сборки на Travis. ‘миграция аутентификации’ выполнена успешно (я думаю, что это ключевая строка для auth_user: Applying auth.0001_initial... OK)
0.22s$ psql -c 'create database travis_ci_test;' -U postgres
CREATE DATABASE
1.50s$ yes | python3 manage.py makemigrations
TEST_ENV...
AWS_INTEGRATION...
Databases ... {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'travis_ci_test', 'USER': 'postgres', 'PASSWORD': '', 'HOST': 'localhost'}
Installed Apps ... ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'races.apps.RacesConfig', 'storages']
No changes detected
The command "yes | python3 manage.py makemigrations" exited with 0.
1.68s$ python3 manage.py migrate auth
TEST_ENV...
AWS_INTEGRATION...
Databases ... {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'travis_ci_test', 'USER': 'postgres', 'PASSWORD': '', 'HOST': 'localhost'}
Installed Apps ... ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'races.apps.RacesConfig', 'storages']
Operations to perform:
Apply all migrations: auth
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
The command "python3 manage.py migrate auth" exited with 0.
1.57s$ python3 manage.py migrate --run-syncdb
TEST_ENV...
AWS_INTEGRATION...
Databases ... {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'travis_ci_test', 'USER': 'postgres', 'PASSWORD': '', 'HOST': 'localhost'}
Installed Apps ... ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'myapp.apps.MyAppConfig', 'storages']
Operations to perform:
Synchronize unmigrated apps: messages, myapp, staticfiles, storages
Apply all migrations: admin, auth, contenttypes, sessions
Synchronizing apps without migrations:
Creating tables...
Creating table myapp_model1
Creating table myapp_model2
Creating table myapp_model3
Creating table myapp_model4
Creating table myapp_model5
Running deferred SQL...
Running migrations:
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying admin.0003_logentry_add_action_flag_choices... OK
Applying sessions.0001_initial... OK
The command "python3 manage.py migrate --run-syncdb" exited with 0.
1.40s$ python3 manage.py test tests/unit_tests
TEST_ENV...
AWS_INTEGRATION...
Databases ... {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'travis_ci_test', 'USER': 'postgres', 'PASSWORD': '', 'HOST': 'localhost'}
Installed Apps ... ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'app.apps.MyAppConfig', 'storages']
Creating test database for alias 'default'...
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "auth_user" does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/commands/test.py", line 26, in run_from_argv
super().run_from_argv(argv)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/commands/test.py", line 56, in handle
failures = test_runner.run_tests(test_labels)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/test/runner.py", line 604, in run_tests
old_config = self.setup_databases()
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/test/runner.py", line 551, in setup_databases
self.parallel, **kwargs
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/test/utils.py", line 174, in setup_databases
serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/base/creation.py", line 68, in create_test_db
run_syncdb=True,
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/__init__.py", line 148, in call_command
return command.execute(*args, **defaults)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 172, in handle
self.sync_apps(connection, executor.loader.unmigrated_apps)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 310, in sync_apps
self.stdout.write(" Running deferred SQL...n")
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 106, in __exit__
self.execute(sql)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 133, in execute
cursor.execute(sql, params)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
The command "python3 manage.py test tests/unit_tests" exited with 1.