def test_create_or_update(self):
        context = self.mox.CreateMockAnything()
        context.make_request("subscriber", "CREATEORUPDATE",
            data=json.dumps([{"id": 1, "ref": "ref"}])).AndReturn(
            json.dumps([{"id": 1, "ref": "ref"}]))
        self.mox.ReplayAll()

        record = Subscriber(context)
        record.backing = {"id": 1, "ref": "ref"}
        record.create_or_update()
        self.assertEqual("1", record.record_id)
        self.assertEqual("ref", record.ref)
        self.mox.VerifyAll()
    def test_create_or_update(self):
        context = self.mox.CreateMockAnything()
        context.make_request("subscriber",
                             "CREATEORUPDATE",
                             data=json.dumps([{
                                 "id": 1,
                                 "ref": "ref"
                             }])).AndReturn(
                                 json.dumps([{
                                     "id": 1,
                                     "ref": "ref"
                                 }]))
        self.mox.ReplayAll()

        record = Subscriber(context)
        record.backing = {"id": 1, "ref": "ref"}
        record.create_or_update()
        self.assertEqual("1", record.record_id)
        self.assertEqual("ref", record.ref)
        self.mox.VerifyAll()