aboutsummaryrefslogtreecommitdiff
path: root/tests/test_postgres.py
diff options
context:
space:
mode:
authorMax Nanis2026-09-02 14:57:14 -0700
committerMax Nanis2026-09-02 14:57:14 -0700
commita63de356383f3dc1d92c44e1167b27de05157146 (patch)
treefc4d9c0676c9d1fa11c4832ad09a1a7261180fec /tests/test_postgres.py
parentba191f535649f483ae064f47b023ee89141f32c5 (diff)
downloadgeneralresearch-a63de356383f3dc1d92c44e1167b27de05157146.tar.gz
generalresearch-a63de356383f3dc1d92c44e1167b27de05157146.zip
django migrations functional
Diffstat (limited to 'tests/test_postgres.py')
-rw-r--r--tests/test_postgres.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/test_postgres.py b/tests/test_postgres.py
index 9794321..de3f5d8 100644
--- a/tests/test_postgres.py
+++ b/tests/test_postgres.py
@@ -70,13 +70,30 @@ class TestPostgresDjangoCreation:
assert len(res) == 1
assert res[0]["count"] == 57
+ def test_django_tables_only_gr(self, gr_db: PostgresConfig):
+ """
+ IMPORTANT: This can't really run with only the GR tables,
+ that's because we have most of the database init fixtures
+ as session scoped; and we can't ensure that this will
+ run before any test that depends on the core thl
+ migrations
+ """
+
+ res = gr_db.execute_sql_query(query="""
+ SELECT COUNT(*)
+ FROM information_schema.tables
+ WHERE table_schema = 'public';
+ """)
+ assert len(res) == 1
+ assert res[0]["count"] == 65
+
def test_django_tables_with_gr(
self, thl_web_rw: PostgresConfig, gr_db: PostgresConfig
):
res = thl_web_rw.execute_sql_query(query="""
- SELECT COUNT(*)
+ SELECT COUNT(*)
FROM information_schema.tables
WHERE table_schema = 'public';
""")
assert len(res) == 1
- assert res[0]["count"] > 57
+ assert res[0]["count"] == 65