diff options
| author | Max Nanis | 2026-09-02 14:57:14 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-09-02 14:57:14 -0700 |
| commit | a63de356383f3dc1d92c44e1167b27de05157146 (patch) | |
| tree | fc4d9c0676c9d1fa11c4832ad09a1a7261180fec /tests | |
| parent | ba191f535649f483ae064f47b023ee89141f32c5 (diff) | |
| download | generalresearch-a63de356383f3dc1d92c44e1167b27de05157146.tar.gz generalresearch-a63de356383f3dc1d92c44e1167b27de05157146.zip | |
django migrations functional
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_postgres.py | 21 |
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 |
