def METHOD_NAME(self):
    fp = mock.Mock()
    fp.name = 'testnamespace-testcollection.tar.gz'
    fp.size = 42
    serializer = serializers.CollectionUploadSerializer(data={'file': fp})
    with pytest.raises(drf_exc.ValidationError) as excinfo:
        serializer.is_valid(raise_exception=True)
    assert excinfo.value.detail['non_field_errors'] == [
        'Invalid filename. Expected: {namespace}-{name}-{version}.tar.gz']