Add real test data for models in unit tests.
Review Request #11382 — Created Jan. 19, 2021 and submitted
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.
E131 continuation line unaligned for hanging indent
Fixed a Review Bot warning.
Revision 2 (+400 -54)
Checks run (2 succeeded)