{{{
FAIL: test_db_table (schema.tests.SchemaTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/runner/runners/2.160.0/work/django/django/django/test/utils.py",
line 370, in inner
return func(*args, **kwargs)
File
"/Users/runner/runners/2.160.0/work/django/django/tests/schema/tests.py",
line 2249, in test_db_table
self.assertForeignKeyExists(Book, "author_id", "schema_otherauthor")
File
"/Users/runner/runners/2.160.0/work/django/django/tests/schema/tests.py",
line 207, in assertForeignKeyExists
self.assertEqual(constraint_fk, (expected_fk_table, field))
AssertionError: Tuples differ: ('schema_author', 'id') !=
('schema_otherauthor', 'id')
First differing element 0:
'schema_author'
'schema_otherauthor'
- ('schema_author', 'id')
+ ('schema_otherauthor', 'id')
? +++++
----------------------------------------------------------------------
Ran 13209 tests in 487.293s
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30964>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Simon Charette):
Pretty sure this is related to the SQLite version installed.
What does `python -c"import sqlite3; print(sqlite3.version_info,
sqlite3.sqlite_version)"` yield?
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:1>
Comment (by Simon Charette):
Probably want to `brew install sqlite` as well at
https://github.com/codingjoe/django/blob/f67edd20b80de813d55f5df79c0d0c6134e8b754/.github/workflows/ci.yml#L52
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:2>
* status: new => closed
* resolution: => needsinfo
Comment:
This passed for me with SQLite 3.24, so I'm going to close assuming that
the SQLite version is the underlying cause.
It's probably `invalid` but I'll give it a `needsinfo` since
7444f3252757ed4384623e5afd7dcfeef3e0c74e added a `check_sqlite_version()`
which raises `if Database.sqlite_version_info < (3, 8, 3)` — so the
version in play must be higher that that — maybe there's room for a
cleanup here, if you can follow-up Joe 🤔
(No worries if not.)
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:3>
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:4>
* status: closed => new
* resolution: needsinfo =>
Comment:
Hold your horses, it's version 3.28.0 which should be supported, right?
{{{
Run python -c "import sqlite3; print(sqlite3.sqlite_version)"
3.28.0
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:5>
* cc: Simon Charette (added)
Comment:
It should indeed be supported but I can't reproduce on macOS Mojave with
3.28.0.
Did `brew install sqlite` help anyhow?
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:6>
Comment (by Johannes Hoppe):
@Simon
{{{
$ brew update
$ brew install sqlite
Warning: sqlite 3.30.1 is already installed and up-to-date
To reinstall 3.30.1, run `brew reinstall sqlite`
}}}
Interestingly enough `sqlite3.sqlite_version` is still 3.28.0.
In am not 100% sure this is a sqlite issue. This could also be something
OS related. Which would make sense considering that it apears to happen
only on macOS.
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:7>
* version: 2.2 => master
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:8>
Comment (by Carlton Gibson):
Hey Joe:
> Interestingly enough sqlite3.sqlite_version is still 3.28.0.
You have to tell Python where to find your SQLite. The internet suggests
LD_LIBRARY_PATH, but on macOS I find you have to set DYLD_LIBRARY_PATH:
{{{
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/sqlite/3.28.1/lib
}}}
Simon has a variation on those instructions here: https://github.com/orf
/django-docker-box/issues/25
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:9>
* status: new => closed
* resolution: => needsinfo
Comment:
OK, I can't reproduce the issue here. I'll keep an eye on it but, short of
more concrete steps, or someone else confirming, I'm not sure what we can
do.
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:10>
* resolution: needsinfo => invalid
Comment:
Thanks Carlton,
I was able to resolve this failure by:
- installing SQLite 3.31.1 using `brew install sqlite`
- Setting `export DYLD_LIBRARY_PATH=/usr/local/Cellar/sqlite/3.31.1/lib`
in the shell startup file (`~/.bashrc` in my case)
''Resolved as `invalid`''
Quick question - Should we add this in the Troubleshooting section of
Contributing guidelines -
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/unit-tests/#troubleshooting?
--
Ticket URL: <https://code.djangoproject.com/ticket/30964#comment:11>