test(external): unique seeded artist per host (fix uq_artist_name in sweep test)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user