af67d01aa2
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
14 lines
592 B
Python
14 lines
592 B
Python
def test_library_item_can_have_null_request(conn):
|
|
with conn.cursor() as cur:
|
|
cur.execute(
|
|
'INSERT INTO "LibraryItem" (id, "requestId", artist, album, path, source, format, '
|
|
'"qualityClass", "importedAt") '
|
|
"VALUES (gen_random_uuid()::text, NULL, 'A', 'B', '/m/A/B', 'scan', 'FLAC', 2, now()) "
|
|
"RETURNING id"
|
|
)
|
|
lib_id = cur.fetchone()[0]
|
|
conn.commit()
|
|
with conn.cursor() as cur:
|
|
cur.execute('SELECT "requestId" FROM "LibraryItem" WHERE id = %s', (lib_id,))
|
|
assert cur.fetchone()[0] is None
|