def test_put_updates(self): source = FakeSource.new() source.put() updates = source.updates = {'status': 'disabled'} Source.put_updates(source) self.assertEqual('disabled', source.key.get().status)
def test_put_updates(self): source = FakeSource.new(None) source.put() updates = source.updates = {'status': 'disabled'} try: # check that source.updates is preserved through pre-put hook since some # Source subclasses (e.g. FacebookPage) use it. FakeSource._pre_put_hook = lambda fake: self.assertEquals(updates, fake.updates) Source.put_updates(source) self.assertEquals('disabled', source.key.get().status) finally: del FakeSource._pre_put_hook