aboutsummaryrefslogtreecommitdiff
path: root/tests/models/gr/test_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/models/gr/test_base.py')
-rw-r--r--tests/models/gr/test_base.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/models/gr/test_base.py b/tests/models/gr/test_base.py
new file mode 100644
index 0000000..323d7b6
--- /dev/null
+++ b/tests/models/gr/test_base.py
@@ -0,0 +1,25 @@
+from typing import Callable
+
+from pydantic import PostgresDsn
+
+from generalresearch.pg_helper import PostgresConfig
+
+
+class TestGRPostgresDjangoCreation:
+
+ def test_django_creation(
+ self,
+ django_db_factory: Callable[..., None],
+ ):
+
+ dsn = django_db_factory("gr_carer")
+ assert isinstance(dsn, PostgresDsn)
+
+ def test_django_tables(self, thl_web_rw: PostgresConfig):
+ res = thl_web_rw.execute_sql_query(query="""
+ SELECT COUNT(*)
+ FROM information_schema.tables
+ WHERE table_schema = 'public';
+ """)
+ assert len(res) == 1
+ assert res[0]["count"] == 56