-
Notifications
You must be signed in to change notification settings - Fork 5
Feat auto indexing #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Fix typo in doc
The key thing to note is that I set auto indexing to be automatic (the signals are added by default). Unless you decide to disable it by default, existing projects that are upgrading would need to note this change in order to prevent duplicate indexing operations on their instance. The PR includes docs for two features (auto-indexing and a decorator to disable auto-indexing) as well as the new setting to control whether auto-indexing is enabled for the project. Tests are included to verify connecting/disconnecting the signals as well as testing the new setting. In order to not mess up the existing tests, I added the disable_auto_indexing decorator to all of the tests that called save(). This also ensures that you're testing the indexing functions directly without the signals getting in the way. |
@calitidexvii Will you have some time to figure out why the coverage step is failing please? |
288df06
to
a2ed052
Compare
@CorrosiveKid The tests are completing ok. The issue is with the |
Codecov Report
@@ Coverage Diff @@
## master #97 +/- ##
===========================================
- Coverage 100.00% 98.14% -1.86%
===========================================
Files 7 9 +2
Lines 138 162 +24
Branches 19 18 -1
===========================================
+ Hits 138 159 +21
- Misses 0 2 +2
- Partials 0 1 +1
Continue to review full report at Codecov.
|
@CorrosiveKid I can add tests for those two lines missing from coverage. Do you need any other changes? |
@calitidexvii Thanks for that. Another change I think might be good is to make the auto indexing disabled by default, and change the decorator to |
@CorrosiveKid I set auto-indexing default to False and removed the I left the decorator as I ran into a problem writing tests for this because override_settings doesn't reinitialize app configs and attaching the signals are dependent on the app config. I asked the question here in case you have any suggestions. To test the decorator for now, I used the workaround mentioned at the end of the question, but I'd rather not write code just to suit tests. And we're still missing coverage for attaching the signals in |
That makes sense, thanks for that. I think I ran into the same problem sometime back with |
PR for #96 feature request "Add post_save and post_delete signals"