An open source, non-profit web search engine
Fix broken tests
blueheron786455a49678962
diff --git a/mwmbl/migrations/0039_batches_device_name.py b/mwmbl/migrations/0039_batches_device_name.pyindex b7b9544..ae32c2d 100644--- a/mwmbl/migrations/0039_batches_device_name.py+++ b/mwmbl/migrations/0039_batches_device_name.py@@ -11,7 +11,12 @@ class Migration(migrations.Migration):operations = [migrations.RunSQL("""- ALTER TABLE batches ADD COLUMN device_name VARCHAR;+ CREATE TABLE IF NOT EXISTS batches (+ url VARCHAR PRIMARY KEY,+ user_id_hash VARCHAR NOT NULL,+ status INT NOT NULL,+ device_name VARCHAR+ );""","""ALTER TABLE batches DROP COLUMN device_name;diff --git a/test/conftest.py b/test/conftest.pyindex 3fab119..c25ce9b 100644--- a/test/conftest.py+++ b/test/conftest.py@@ -31,3 +31,11 @@ def async_debug_loop(event_loop):event_loop.set_debug(True)event_loop.slow_callback_duration = 0.1yield event_loop+++def index_db():+ """Create the index database tables (batches, etc.) for tests that need them."""+ from mwmbl.apps import create_index_db++ create_index_db()diff --git a/test/test_export_judgments.py b/test/test_export_judgments.pyindex d7fc3fe..00e2bce 100644--- a/test/test_export_judgments.py+++ b/test/test_export_judgments.py@@ -11,6 +11,14 @@ from mwmbl.models import Curation, DomainSubmission, FlagCuration, SearchResultVUser = get_user_model()[email protected](autouse=True)+def index_db():+ """Create the index database tables for tests that need them."""+ from mwmbl.apps import create_index_db++ create_index_db()++def doc(url, title="title", extract="extract", score=1.0, state=None, user_ids=None):return {"url": url,diff --git a/test/test_large_url_list.py b/test/test_large_url_list.pyindex 56c3a98..107c335 100644--- a/test/test_large_url_list.py+++ b/test/test_large_url_list.py@@ -10,6 +10,14 @@ from mwmbl.models import SearchResultVoteUser = get_user_model()[email protected](autouse=True)+def index_db():+ """Create the index database tables for tests that need them."""+ from mwmbl.apps import create_index_db++ create_index_db()++@pytest.fixturedef verified_user():"""Create a user with verified email"""diff --git a/test/test_marketing_consent.py b/test/test_marketing_consent.pyindex c44bff9..8d857b2 100644--- a/test/test_marketing_consent.py+++ b/test/test_marketing_consent.py@@ -15,6 +15,14 @@ CONSENT_URL = "/api/v1/platform/marketing-consent"UNSUBSCRIBE_URL = "/api/v1/platform/marketing/unsubscribe"[email protected](autouse=True)+def index_db():+ """Create the index database tables for tests that need them."""+ from mwmbl.apps import create_index_db++ create_index_db()++@pytest.fixturedef verified_user(db):user = User.objects.create_user(