one test failed after testing the suite

FAIL: test_db_table (schema.tests.SchemaTests)

Traceback (most recent call last):
File “/Users/nanliu/github/django/django/test/utils.py”, line 381, in inner
return func(*args, **kwargs)
File “/Users/nanliu/github/django/tests/schema/tests.py”, line 2280, in test_db_table
self.assertForeignKeyExists(Book, “author_id”, “schema_otherauthor”)
File “/Users/nanliu/github/django/tests/schema/tests.py”, line 201, 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 13599 tests in 435.972s

FAILED (failures=1, skipped=1032, expected failures=4)

I am not sure if this is the issue that the master version has after looking in Jenkins cuz Jenkins doesn’t give too many details. And also why are so many test cases skipped? Sorry! Im new to open source and want to make some contribution to improve my skills

Most skipped test cases are based on your database backend. Presumably you’re running the tests with the default settings that use a SQLite backend.

What Python versions and Git commit are you at? The test passes for me on latest master with Python 3.7:

$ ./runtests.py schema
Testing against Django installed in '/Users/chainz/Documents/Projects/django/django' with up to 12 processes
Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
System check identified no issues (0 silenced).
.s............sss..s.ss.....s..ss.ssss.....sss.........s...................s........s................................s......s.s...s
----------------------------------------------------------------------
Ran 131 tests in 0.956s

OK (skipped=24)
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
$ python --version
Python 3.7.6
$ git rev-parse HEAD
89032876f427a77ab4de26493190280377567d1c

my python version is 3.7.3.
And i got the same result from “git rev-parse HEAD”
Is it something to do with python version tho?
btw, im running the cmd line using virtualenv

There’s a tiny chance this is caused by a bug in your Python or SQLite versions being old.

It’s also worth checking if the test still fails when you run only the schema tests like I did, or if it fails when you run --reverse, to check for test isolation problems.

but i did install all dependencies from the requirements. if that was the reason, that would probably mean that we may need to update the file.

And i did ./runtests.py schema --reverse, and it failed with the error message:

FAIL: test_db_table (schema.tests.SchemaTests)

Traceback (most recent call last):
File “/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py”, line 59, in testPartExecutor
yield
File “/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py”, line 615, in run
testMethod()
File “/Users/nanliu/github/django/django/test/utils.py”, line 381, in inner
return func(*args, **kwargs)
File “/Users/nanliu/github/django/tests/schema/tests.py”, line 2280, in test_db_table
self.assertForeignKeyExists(Book, “author_id”, “schema_otherauthor”)
File “/Users/nanliu/github/django/tests/schema/tests.py”, line 201, in assertForeignKeyExists
self.assertEqual(constraint_fk, (expected_fk_table, field))
File “/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py”, line 839, in assertEqual
assertion_func(first, second, msg=msg)
File “/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py”, line 1056, in assertTupleEqual
self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
File “/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py”, line 1027, in assertSequenceEqual
self.fail(msg)
File “/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/unittest/case.py”, line 680, in fail
raise self.failureException(msg)
AssertionError: Tuples differ: (‘schema_author’, ‘id’) != (‘schema_otherauthor’, ‘id’)

First differing element 0:
‘schema_author’
‘schema_otherauthor’

  • (‘schema_author’, ‘id’)
  • (‘schema_otherauthor’, ‘id’)
    ? +++++

Ran 131 tests in 0.973s

FAILED (failures=1, errors=109, skipped=24)

Python isn’t from the dependencies, and includes SQLite. You ahve Python 3.7.3 installed, whilst I’m using 3.7.6. Please try upgrading Python first.

I’m running python3.9.4 and also finding this same error. It happens after I have run the tests once. Every subsequent test schema.tests.SchemaTests.test_db_table fails with the error message:

First differing element 0:
'schema_author'
'schema_otherauthor'

- ('schema_author', 'id')
+ ('schema_otherauthor', 'id')
?          +++++