revsys / django-test-plus

Useful additions to Django's default TestCase
https://django-test-plus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
612 stars 62 forks source link

Assorted fixes following usage of the utilities. #201

Closed nessita closed 1 year ago

nessita commented 1 year ago

Including:

nessita commented 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
jefftriplett commented 1 year ago

cc @frankwiles to roll a new release