Add real test data for models in unit tests.

Review Request #11382 — Created Jan. 19, 2021 and submitted

Information

Django Evolution
release-2.x

Reviewers

The test suite operated solely on schema changes, without any data in
the database for those models. This meant that the tests missed some
important things. For instance, on SQLite, Django Evolution 2.0
regressed adding non-NULL fields when there's data in a table, and this
wasn't caught in the tests due to the lack of data.

Now every test suite can inject data into the models prior to mutation,
ensuring that we're operating in a more real-world scenario.

This currently breaks the SQLite tests (revealing the aforementioned
bug), but those will be fixed in an upcoming change.

Unit tests pass except on SQLite (where the bug manifests).

Unit tests pass completely with an upcoming fix.

Summary ID
Add real test data for models in unit tests.
The test suite operated solely on schema changes, without any data in the database for those models. This meant that the tests missed some important things. For instance, on SQLite, Django Evolution 2.0 regressed adding non-NULL fields when there's data in a table, and this wasn't caught in the tests due to the lack of data. Now every test suite can inject data into the models prior to mutation, ensuring that we're operating in a more real-world scenario. This currently breaks the SQLite tests (revealing the aforementioned bug), but those will be fixed in an upcoming change.
719d3133205c60ff20848343e959142074894df7
Description From Last Updated

E131 continuation line unaligned for hanging indent

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.x (0dbed81)