Skip to content

Commit

Permalink
Fix to test to ensure stable ordering of queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed May 3, 2018
1 parent ca4c1cd commit 6b9e14a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,16 +992,16 @@ def test_delete_instance_regression(self):
a2.delete_instance(recursive=True)

queries = [logrecord.msg for logrecord in self._qh.queries[-5:]]
self.assertEqual(queries, [
self.assertEqual(sorted(queries, reverse=True), [
('DELETE FROM "did" WHERE ("c_id" IN ('
'SELECT "t1"."id" FROM "dic" AS "t1" WHERE ("t1"."b_id" IN ('
'SELECT "t2"."id" FROM "dib" AS "t2" WHERE ("t2"."a_id" = ?)'
'))))', [2]),
('DELETE FROM "dic" WHERE ("b_id" IN ('
'SELECT "t1"."id" FROM "dib" AS "t1" WHERE ("t1"."a_id" = ?)'
'))', [2]),
('DELETE FROM "dib" WHERE ("a_id" = ?)', [2]),
('DELETE FROM "diba" WHERE ("a_id" = ?)', ['a2']),
('DELETE FROM "dib" WHERE ("a_id" = ?)', [2]),
('DELETE FROM "dia" WHERE ("id" = ?)', [2])
])

Expand Down

0 comments on commit 6b9e14a

Please sign in to comment.