Skip to content

Commit 2375856

Browse files
committed
fix tests
1 parent a716b30 commit 2375856

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

dsd_pythonanywhere/platform_deployer.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,16 @@ def _get_deployed_project_name(self):
126126
return os.getenv("API_USER")
127127

128128
def _get_repo_name(self) -> str:
129-
"""Get the repository name from the git remote URL."""
130-
origin_url = self._get_origin_url()
131-
return Path(origin_url).stem
129+
"""Get the repository name from the git remote URL.
130+
131+
Falls back to the project root directory name if no remote is configured.
132+
"""
133+
try:
134+
origin_url = self._get_origin_url()
135+
return Path(origin_url).stem
136+
except Exception:
137+
# No remote configured, use project directory name
138+
return dsd_config.project_root.name
132139

133140
def _prep_automate_all(self):
134141
"""Take any further actions needed if using automate_all."""

tests/integration_tests/test_setup_script.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import pytest
88

9-
109
# --- Fixtures ---
1110

1211

@@ -74,11 +73,12 @@ def test_setup_script_creates_env_file(setup_script_result):
7473
assert env_file.exists()
7574

7675
env_content = env_file.read_text()
77-
assert "ON_PYTHONANYWHERE=true" in env_content
78-
assert "DJANGO_SECRET_KEY=" in env_content
76+
assert "DEBUG=TRUE" in env_content
77+
assert "ON_PYTHONANYWHERE=TRUE" in env_content
78+
assert "SECRET_KEY=" in env_content
7979

8080
# Verify secret key is not empty
8181
for line in env_content.splitlines():
82-
if line.startswith("DJANGO_SECRET_KEY="):
82+
if line.startswith("SECRET_KEY="):
8383
secret_key = line.split("=", 1)[1]
8484
assert len(secret_key) == 50

0 commit comments

Comments
 (0)