Fixed #23947 -- Django's test suite doesn't pass in reverse order

Fixed inconsistent tests when running Django's test suite with --reverse option.
could we make the setUpClass methods a mixin so we don't have to repeat them?