def METHOD_NAME(self):
    fp = mock.Mock()
    fp.name = 'testnamespace-testcollection-1.2.3.tar.gz'
    fp.size = 42
    serializer = serializers.CollectionUploadSerializer(data={'file': fp})
    serializer.is_valid(raise_exception=True)
    filename = serializer.validated_data['filename']
    assert filename.namespace == 'testnamespace'
    assert filename.name == 'testcollection'
    assert filename.version == semantic_version.Version('1.2.3')