See #272: updated API to return upload data on tracks

This commit is contained in:
Eliot Berriot 2018-10-26 14:18:50 +02:00
parent 8489c79c89
commit d3f8fb6cb0
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
16 changed files with 97 additions and 142 deletions

View file

@ -464,24 +464,6 @@ def test_library_queryset_with_follows(factories):
assert l2._follows == [follow]
def test_annotate_duration(factories):
tf = factories["music.Upload"](duration=32)
track = models.Track.objects.annotate_duration().get(pk=tf.track.pk)
assert track.duration == 32
def test_annotate_file_data(factories):
tf = factories["music.Upload"](size=42, bitrate=55, mimetype="audio/ogg")
track = models.Track.objects.annotate_file_data().get(pk=tf.track.pk)
assert track.size == 42
assert track.bitrate == 55
assert track.mimetype == "audio/ogg"
@pytest.mark.parametrize(
"model,factory_args,namespace",
[