def METHOD_NAME(self):
    instance = Instance(user=self.user, xform=self.xform)
    metadata = MetaData(data_type="media")
    metadata.content_object = instance
    filename = "filename"
    self.assertEqual(
        upload_to(metadata, filename),
        "{}/{}/{}".format(self.user.username, "formid-media", filename),
    )
    # test instance with anonymous user
    instance_without_user = Instance(xform=self.xform)
    metadata.content_object = instance_without_user
    self.assertEqual(
        upload_to(metadata, filename),
        "{}/{}/{}".format(self.xform.user.username, "formid-media", filename),
    )