diff options
| author | stuppie | 2026-10-13 14:50:37 -0700 |
|---|---|---|
| committer | stuppie | 2026-10-13 14:50:37 -0700 |
| commit | 6df4d8a8d66c7e8071ef25c783a89b34a5671701 (patch) | |
| tree | 492ccf82ea64fc3bf89f341dcc7432d9b7d9a553 /tests/models/gr | |
| parent | c53c0f938684bbc98b7cccac2d886a6926b6e7f2 (diff) | |
| download | generalresearch-6df4d8a8d66c7e8071ef25c783a89b34a5671701.tar.gz generalresearch-6df4d8a8d66c7e8071ef25c783a89b34a5671701.zip | |
pytest fixtures django_db_factory using gr in this project
Diffstat (limited to 'tests/models/gr')
| -rw-r--r-- | tests/models/gr/test_base.py | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/tests/models/gr/test_base.py b/tests/models/gr/test_base.py index 5ab5dff..d312501 100644 --- a/tests/models/gr/test_base.py +++ b/tests/models/gr/test_base.py @@ -1,41 +1,12 @@ -from __future__ import annotations - -import subprocess from collections.abc import Callable -from pathlib import Path -from typing import TYPE_CHECKING -import pytest from pydantic import PostgresDsn -if TYPE_CHECKING: - from generalresearch.pg_helper import PostgresConfig - class TestGRPostgresDjangoCreation: - - def test_git(self, gr_repo: Callable[..., Path]): - repo_path = gr_repo() - - try: - # Run the git command inside the target directory - result = subprocess.run( - ["git", "rev-parse", "--is-inside-work-tree"], - cwd=repo_path, - capture_output=True, - text=True, - check=True, - ) - # Check if the output string is exactly "true" - assert result.stdout.strip() == "true" - - except (subprocess.CalledProcessError, FileNotFoundError) as e: - pytest.fail(f"Directory is not a Git repo or Git is not installed: {e}") - def test_django_creation( self, - django_db_factory: Callable[..., None], + django_db_factory: Callable[..., PostgresDsn], ): - - dsn = django_db_factory("gr.common") + dsn = django_db_factory("generalresearch.gr_django") assert isinstance(dsn, PostgresDsn) |
