def create_marketing_product_usage(checkin_date, instance_identifier, facts):
    mpu = MarketingProductUsage()
    mpu.splice_server = SPLICE_SERVER
    mpu.instance_identifier = instance_identifier
    mpu.facts = facts
    mpu.checkin_date = checkin_date
    return mpu
    def test_uploading_duplicate(self):
        found = MarketingProductUsage.objects()
        self.assertEquals(len(found), 0)

        datestr = "2012-12-06T11:13:06.432367"
        mpu = MarketingProductUsage()
	mpu.instance_identifier="instance-1"
	mpu.splice_server = "ss-1"
	mpu.checkin_date=datestr
        mpu.save()

        self.assertEquals(len(found), 1)
        example = {"objects":[mpu]}
        post_data = utils.obj_to_json(example)
        LOG.info("Calling api for marketing product usage import with post data: '%s'" % (post_data))
        resp = self.raw_api_client.post('/api/v1/marketingproductusage/', format='json', data=post_data,
                                        SSL_CLIENT_CERT=self.expected_valid_splice_server_identity_pem)
        self.assertEquals(resp.status_code, 204)
        # Now check that the server api saved the object as expected
        found = MarketingProductUsage.objects()
        self.assertEquals(len(found), 1)
        self.assertEquals(found[0].instance_identifier, mpu.instance_identifier)