self = <django.db.backends.utils.CursorWrapper object at 0x7fde38435dd8>
sql = 'SELECT "deposit"."id", "deposit"."reception_date", "deposit"."complete_date", "deposit"."collection_id", "deposit"."e..., "deposit"."parent_id", "deposit"."check_task_id", "deposit"."load_task_id", "deposit"."metadata_only" FROM "deposit"'
params = ()
ignored_wrapper_args = (False, {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fde3c1e2320>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7fde38435dd8>})
def _execute(self, sql, params, *ignored_wrapper_args):
self.db.validate_no_broken_transaction()
with self.db.wrap_database_errors:
if params is None:
return self.cursor.execute(sql)
else:
> return self.cursor.execute(sql, params)
E psycopg2.errors.UndefinedColumn: column deposit.metadata_only does not exist
E LINE 1: ...posit"."check_task_id", "deposit"."load_task_id", "deposit"....
E ^
.tox/py3/lib/python3.7/site-packages/django/db/backends/utils.py:84: UndefinedColumn
The above exception was the direct cause of the following exception:
request = <SubRequest 'django_db_setup' for <Function test_migrations_20_rename_swhid_column_in_deposit_model>>
django_test_environment = None
django_db_blocker = <pytest_django.plugin._DatabaseBlocker object at 0x7fde3d909710>
django_db_use_migrations = True, django_db_keepdb = False
django_db_createdb = False, django_db_modify_db_settings = None
@pytest.fixture(scope="session")
def django_db_setup(
request,
django_test_environment: None,
django_db_blocker,
django_db_use_migrations: bool,
django_db_keepdb: bool,
django_db_createdb: bool,
django_db_modify_db_settings: None,
) -> None:
"""Top level fixture to ensure test databases are available"""
from django.test.utils import setup_databases, teardown_databases
setup_databases_args = {}
if not django_db_use_migrations:
_disable_migrations()
if django_db_keepdb and not django_db_createdb:
setup_databases_args["keepdb"] = True
with django_db_blocker.unblock():
db_cfg = setup_databases(
verbosity=request.config.option.verbose,
interactive=False,
> **setup_databases_args
)
.tox/py3/lib/python3.7/site-packages/pytest_django/fixtures.py:125:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/django/test/utils.py:174: in setup_databases
serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
.tox/py3/lib/python3.7/site-packages/django/db/backends/base/creation.py:72: in create_test_db
run_syncdb=True,
.tox/py3/lib/python3.7/site-packages/django/core/management/__init__.py:148: in call_command
return command.execute(*args, **defaults)
.tox/py3/lib/python3.7/site-packages/django/core/management/base.py:364: in execute
output = self.handle(*args, **options)
.tox/py3/lib/python3.7/site-packages/django/core/management/base.py:83: in wrapped
res = handle_func(*args, **kwargs)
.tox/py3/lib/python3.7/site-packages/django/core/management/commands/migrate.py:234: in handle
fake_initial=fake_initial,
.tox/py3/lib/python3.7/site-packages/django/db/migrations/executor.py:117: in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
.tox/py3/lib/python3.7/site-packages/django/db/migrations/executor.py:147: in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
.tox/py3/lib/python3.7/site-packages/django/db/migrations/executor.py:245: in apply_migration
state = migration.apply(state, schema_editor)
.tox/py3/lib/python3.7/site-packages/django/db/migrations/migration.py:124: in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
.tox/py3/lib/python3.7/site-packages/django/db/migrations/operations/special.py:190: in database_forwards
self.code(from_state.apps, schema_editor)
.tox/py3/lib/python3.7/site-packages/swh/deposit/migrations/0021_deposit_origin_url_20201124_1438.py:8: in fill_origin_url
for deposit in Deposit.objects.all():
.tox/py3/lib/python3.7/site-packages/django/db/models/query.py:274: in __iter__
self._fetch_all()
.tox/py3/lib/python3.7/site-packages/django/db/models/query.py:1242: in _fetch_all
self._result_cache = list(self._iterable_class(self))
.tox/py3/lib/python3.7/site-packages/django/db/models/query.py:55: in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
.tox/py3/lib/python3.7/site-packages/django/db/models/sql/compiler.py:1142: in execute_sql
cursor.execute(sql, params)
.tox/py3/lib/python3.7/site-packages/django/db/backends/utils.py:67: in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
.tox/py3/lib/python3.7/site-packages/django/db/backends/utils.py:76: in _execute_with_wrappers
return executor(sql, params, many, context)
.tox/py3/lib/python3.7/site-packages/django/db/backends/utils.py:84: in _execute
return self.cursor.execute(sql, params)
.tox/py3/lib/python3.7/site-packages/django/db/utils.py:89: in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.utils.CursorWrapper object at 0x7fde38435dd8>
sql = 'SELECT "deposit"."id", "deposit"."reception_date", "deposit"."complete_date", "deposit"."collection_id", "deposit"."e..., "deposit"."parent_id", "deposit"."check_task_id", "deposit"."load_task_id", "deposit"."metadata_only" FROM "deposit"'
params = ()
ignored_wrapper_args = (False, {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7fde3c1e2320>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7fde38435dd8>})
def _execute(self, sql, params, *ignored_wrapper_args):
self.db.validate_no_broken_transaction()
with self.db.wrap_database_errors:
if params is None:
return self.cursor.execute(sql)
else:
> return self.cursor.execute(sql, params)
E django.db.utils.ProgrammingError: column deposit.metadata_only does not exist
E LINE 1: ...posit"."check_task_id", "deposit"."load_task_id", "deposit"....
E ^
.tox/py3/lib/python3.7/site-packages/django/db/backends/utils.py:84: ProgrammingError
TEST RESULT
TEST RESULT
- Run At
- Feb 23 2022, 11:23 AM