Wanting to Contribute

84 views
Skip to first unread message

Skyler Cain

unread,
Jan 12, 2021, 10:51:01 AM1/12/21
to Django developers (Contributions to Django itself)
Hello all!


But after running my tests I get the following failure (when running all or individual). Any thoughts / suggestions would be much appreciated.

(django) skylercain:~/code/django/tests [master]$ ./runtests.py schema.tests.SchemaTests.test_db_table
Testing against Django installed in '/Users/skylercain/code/django/django'
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
F
======================================================================
FAIL: test_db_table (schema.tests.SchemaTests)
Tests renaming of the table
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/skylercain/code/django/django/test/utils.py", line 382, in inner
    return func(*args, **kwargs)
  File "/Users/skylercain/code/django/tests/schema/tests.py", line 2339, in test_db_table
    self.assertForeignKeyExists(Book, "author_id", "schema_otherauthor")
  File "/Users/skylercain/code/django/tests/schema/tests.py", line 213, 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 1 test in 0.015s

FAILED (failures=1)
Destroying test database for alias 'default'...

Carlton Gibson

unread,
Jan 12, 2021, 11:13:29 AM1/12/21
to django-d...@googlegroups.com
Hi Skyler. 

Welcome. 

That’ll be your SQLite version. 

MacOS tends to bundle an old one — and updating can be a little tricky because of the “System integrity protection”, not letting you specify a DYLD_LIBRARY_PATH.

See the instructions here for getting a newer SQLite version: 

It might not work because of SIP. 

Try this: 

~ $ DYLD_LIBRARY_PATH="testing" python -c "import os; print(os.getenv('DYLD_LIBRARY_PATH'))"
None

If you get that your Python is running via SIP. You’ll need to install Python in your home folder somewhere. 

I use pyenv but the shims that use still go view /bin/env, so SIP is in play. 

You have to do this kind of thing: 

~ $ DYLD_LIBRARY_PATH="testing" $(pyenv which python) -c "import os; print(os.getenv('DYLD_LIBRARY_PATH'))"
testing

Hopefully that makes sense and helps. If not reply and I’ll see if I can help some more. 

You can always ignore the failure, or use Postgres: 
https://postgresapp.com is a very easy to get going with. 

Kind regards, Carlton 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/75e140c4-facf-456f-8605-80a72662cf03n%40googlegroups.com.

Skyler Cain

unread,
Jan 12, 2021, 12:27:52 PM1/12/21
to django-d...@googlegroups.com
I ran the code to ensure that JSON1 extension is working within sqlite3. Can I check which version I need -- is that somewhere? Also if the JSON1 extension is working what other functionality do I need to check for? 

I was not using a customly installed version of python -- which I've now switched to. However I'm still getting the same error message. I ran your code to set and test the DYLD_LIBRARY_PATH and the first example worked for me.

Thanks for your help I'd like to get everything working if possible then move on to PostgreSQL.

You received this message because you are subscribed to a topic in the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-developers/TvGYJyj-ouo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAJwKpyQh32UYkxAHma-wRY3WhY36oiuWjhmLCGLm4%2BxGHAgvRQ%40mail.gmail.com.

Carlton Gibson

unread,
Jan 12, 2021, 12:43:39 PM1/12/21
to django-d...@googlegroups.com
I ran your code to set and test the DYLD_LIBRARY_PATH and the first example worked for me.

Did it give None or ‘testing’ — only if the latter is the environment variable reaching the Python process. (So only they can you override the default version)

~ $ python -c "import sqlite3; print(sqlite3.sqlite_version)"
3.32.3

Minimum version is currently 3.8.3

Skyler Cain

unread,
Jan 12, 2021, 2:13:28 PM1/12/21
to django-d...@googlegroups.com
I got 'testing' returned. With that command I'm getting:

(django-2) skylercain:~/code/django [master]$ python -c "import sqlite3; print(sqlite3.sqlite_version)"
3.32.3

Should I try an earlier version?

Carlton Gibson

unread,
Jan 13, 2021, 1:54:53 AM1/13/21
to Django developers (Contributions to Django itself)
OK, this was reported as https://code.djangoproject.com/ticket/31765, something* to do with macOS's bundled SQLite. 
* technical term. 

I assume you're running against that, so can you perhaps comment on the issue with your `platform.mac_ver()` and we can have a look. 

Thanks! 

Skyler Cain

unread,
Jan 14, 2021, 8:59:47 AM1/14/21
to Django developers (Contributions to Django itself)
Should I add a comment to the closed Django issue?

Carlton Gibson

unread,
Jan 14, 2021, 9:56:15 AM1/14/21
to django-d...@googlegroups.com
If you comment there, with sufficient details I can try to reproduce it. 

Skyler Cain

unread,
Jan 14, 2021, 9:59:44 AM1/14/21
to django-d...@googlegroups.com

Carlton Gibson

unread,
Jan 14, 2021, 10:01:23 AM1/14/21
to django-d...@googlegroups.com
Thank you for bringing it up! 

And welcome aboard! I hope you have fun contributing! 

Kind regards, Carlton 
Reply all
Reply to author
Forward
0 new messages