test(external): unique seeded artist per host (fix uq_artist_name in sweep test)
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 20s
CI / backend-lint-and-test (push) Successful in 33s
CI / integration (push) Successful in 3m18s

This commit is contained in:
2026-06-14 15:33:49 -04:00
parent 96e984cded
commit 82b26b8aaa
+5 -4
View File
@@ -24,18 +24,19 @@ class _FakeRedis:
def _seed(db_sync, *, host="pixeldrain", status="pending"):
artist = Artist(name="Ext Artist", slug="ext-artist")
# Key per host so a single test can seed several (artist name is UNIQUE).
artist = Artist(name=f"Ext {host}", slug=f"ext-{host}")
db_sync.add(artist)
db_sync.flush()
source = Source(
artist_id=artist.id, platform="patreon",
url="https://patreon.com/ext", enabled=True, config_overrides={},
url=f"https://patreon.com/{host}", enabled=True, config_overrides={},
)
db_sync.add(source)
db_sync.flush()
post = Post(
source_id=source.id, artist_id=artist.id, external_post_id="EXT1",
post_url="https://patreon.com/posts/EXT1",
source_id=source.id, artist_id=artist.id, external_post_id=f"EXT-{host}",
post_url=f"https://patreon.com/posts/{host}",
)
db_sync.add(post)
db_sync.flush()