Fix a unit test breakage involving the Search tests on Django 1.11.

Review Request #10855 — Created Jan. 24, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

One of our unit tests for search signal handling deletes the
SiteConfiguration from the database in order to ensure some
functionality in the signal processor doesn't crash. While this worked
on Django 1.6, it breaks on 1.11, causing a subsequent test to fail to
find a SiteConfiguration in the database.

This was a pretty scary thing for us to really delete, so we're not
doing that anymore. Instead, we're now spying on
SiteConfiguration.objects.get_current() and simulating an issue
fetching it from the database. This is far less invasive and more
future-proof.

Unit tests pass on Django 1.6 and 1.11.

Summary ID
Fix a unit test breakage involving the Search tests on Django 1.11.
One of our unit tests for search signal handling deletes the `SiteConfiguration` from the database in order to ensure some functionality in the signal processor doesn't crash. While this worked on Django 1.6, it breaks on 1.11, causing a subsequent test to fail to find a `SiteConfiguration` in the database. This was a pretty scary thing for us to really delete, so we're not doing that anymore. Instead, we're now spying on `SiteConfiguration.objects.get_current()` and simulating an issue fetching it from the database. This is far less invasive and more future-proof.
42b537c74c790e09bae4b34a9bb34f0b3cd09013
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (48212d9)