Changes between Initial Version and Version 2 of Ticket #33626


Ignore:
Timestamp:
Apr 8, 2022, 2:41:41 AM (3 years ago)
Author:
Himanshu Balasamanta
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33626 – Description

    initial v2  
    1 In current source code, in the **_unregister_lookup** method, [https://github.com/django/django/blame/main/django/db/models/query_utils.py#L212], the cache is not cleared, which should be done, as it is done in **register_lookup**, https://github.com/django/django/blame/main/django/db/models/query_utils.py#L202.
    2 Corresponding to this change, minor changes need to be brought in the **schema.tests.SchemaTests.test_func_unique_constraint_lookups** test.
     1Hi Carlton.
     2I have opened the PR https://github.com/django/django/pull/15569, and have also modified the test that was supposed to throw error(schema.tests.SchemaTests.test_func_unique_constraint_lookups).
     3
     4There is no test that checks if the lookup stays in cache after unregistering it. In my PR, I have added an assert statement to check it in **custom_lookups.tests.LookupTests.test_lookups_caching** test. Running the test without clearing cache from _unregister_lookup will fail.
     5
     6The cache stays between tests, so you are likely to get different results running tests independently and running all tests in a module. (PS: I faced this problem earlier running tests individually and together gave different results.)
Back to Top