Fix a unit test breakage involving the Search tests on Django 1.11.
Review Request #10855 — Created Jan. 24, 2020 and submitted — Latest diff uploaded
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 aSiteConfiguration
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.