"""Unit tests for legacy database model.""" from pricing.models import legacy_database import pytest from tests.utils import db_legacy_operations @pytest.fixture def legacy_db_fixture(): """Drop and re-create all the SQLite legacy tables and seed them.""" db_legacy_operations.create_legacy_tables() def test_can_get_releases(legacy_db_fixture): """Test that we can read the rows in the releases table.""" rows = legacy_database.query_legacy_db('SELECT * FROM releases') assert len(rows) == 0 def test_get_all_product_pricing_tiers(legacy_db_fixture): """Test loading product pricing tiers from legacy db.""" rows = legacy_database.get_all_product_pricing_tiers(1) assert len(rows) == 0 def test_get_all_product_territory_pricing(legacy_db_fixture): """Test loading product territory pricing from the legacy db.""" rows = legacy_database.get_all_product_territory_pricing(1, 1, 1) assert len(rows) == 0 def test_get_product_track_territory_pricing(legacy_db_fixture): """Test loading product track territory pricing from the legacy db.""" rows = legacy_database.get_product_track_territory_pricing(1, 1, 1) assert len(rows) == 0 def test_get_product_tracks(legacy_db_fixture): """Test loading product tracks from the legacy db.""" rows = legacy_database.get_product_tracks(1) assert len(rows) == 0 def test_get_default_pricing_codes(legacy_db_fixture): """Test loading default price codes from the legacy db.""" rows = legacy_database.get_default_pricing_codes(1, 1, 1) assert len(rows) == 0 def test_get_all_film_product_ids(legacy_db_fixture): """Test loading all film ids.""" rows = legacy_database.get_all_film_product_ids() assert len(rows) == 0