Closed nessita closed 1 year ago
The new extended query counter message looks like this:
def fail(self, msg=None):
"""Fail immediately, with the given message."""
> raise self.failureException(msg)
E AssertionError: 2 not less than 1 : 2 queries executed, expected less than 1 Executed queries were:
E
E SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > 'XXXXXXX'::timestamptz AND "django_session"."session_key" = 'XXXXXXXXX') LIMIT 21
E
E SELECT "users_user"."id", "users_user"."password", "... FROM "users_user" WHERE "users_user"."id" = XXXX LIMIT 21
cc @frankwiles to roll a new release
Including:
assertIn
which produces a clearer message on error.get_context
inassertContext
andassertInContext
.assertInContext
closer toget_context
andassertContext
.assertNumQueriesLessThan
to show executed queries.