Remove recorded test migrations before test runs.

Review Request #10575 — Created June 3, 2019 and submitted

chipx86
Django Evolution
master
django-evolution

Django's list of applied migrations persist between individual unit
tests, which causes state leakage issues, breaking some tests that are
sensitive to the migration history.

This change introduces a new MigrationsTestsMixin class, which handles
removing the list of applied test migrations before running a test. It
makes use of a new unrecord_applied_migrations, which can unrecord
specific migration names or all for an app.

To improve performance, both record_applied_migrations and
unrecord_applied_migrations now operate on the MigrationRecorder's
queryset, rather than using the utility functions, so that we can
manipulate more than one entry in one operation instead of several.

Unit tests pass on all supported versions of Django.

Summary
Remove recorded test migrations before test runs.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (fcda0aa)
Loading...