﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30617	test_check_constraints sometimes fails with no such table error.	Jakub Kulík	nobody	"Hi,

since the 1.11.22 version of Django we sometimes get an error when running a test suite:

`test_check_constraints (backends.tests.FkConstraintsTests) ... ERROR`

I tried to find the exact problem but was unsuccessful. It doesn't happen when just a single test is run, I wasn't able to reproduce it when `backends` only tests were run either and even when the entire test suite is run, it only manifests itself sometimes (and when it does, it is always just this single test).

We never saw this in 1.11.20 or any previous version.

Here is an entire error message:
{{{
======================================================================
ERROR: test_check_constraints (backends.tests.FkConstraintsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/.../django/db/backends/utils.py"", line 62, in execute
    return self.cursor.execute(sql)
  File ""/.../django/db/backends/sqlite3/base.py"", line 326, in execute
    return Database.Cursor.execute(self, query)
sqlite3.OperationalError: no such table: alter_alter_field_reloads_state_on_fk_target_changes_pony__old

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File ""/.../tests/backends/tests.py"", line 1026, in test_check_constraints
    connection.check_constraints()
  File ""/.../django/db/backends/sqlite3/base.py"", line 286, in check_constraints
    column_name, referenced_column_name,
  File ""/.../django/db/backends/utils.py"", line 64, in execute
    return self.cursor.execute(sql, params)
  File ""/.../django/db/utils.py"", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File ""/.../django/utils/six.py"", line 685, in reraise
    raise value.with_traceback(tb)
  File ""/.../django/db/backends/utils.py"", line 62, in execute
    return self.cursor.execute(sql)
  File ""/.../django/db/backends/sqlite3/base.py"", line 326, in execute
    return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: no such table: alter_alter_field_reloads_state_on_fk_target_changes_pony__old
}}}
"	Bug	closed	Testing framework	1.11	Normal	worksforme			Unreviewed	0	0	0	0	0	0
