def METHOD_NAME(self):
    model_instance = Project(created_by=self.user)
    metadata = MetaData(data_type="media")
    metadata.content_object = model_instance
    filename = "filename"
    self.assertEqual(
        upload_to(metadata, filename),
        "{}/{}/{}".format(self.user.username, "formid-media", filename),
    )
    model_instance = XForm(user=self.user, created_by=self.user)
    metadata = MetaData(data_type="media")
    metadata.content_object = model_instance
    filename = "filename"
    self.assertEqual(
        upload_to(metadata, filename),
        "{}/{}/{}".format(self.user.username, "formid-media", filename),
    )