def test_sticky_get_all(self): values = get_fake_sticky('1') st1 = db_api.sticky_create(self.conf, values) st2 = db_api.sticky_create(self.conf, values) stickies = [dict(sticky.iteritems()) for sticky in db_api.sticky_get_all(self.conf)] self.assertEqual(stickies, [dict(st.iteritems()) for st in [st1, st2]])
def test_sticky_destroy_by_sf_id(self): values = get_fake_sticky('1') sticky_ref1 = db_api.sticky_create(self.conf, values) values = get_fake_sticky('2') sticky_ref2 = db_api.sticky_create(self.conf, values) db_api.sticky_destroy_by_sf_id(self.conf, '1') stickies = db_api.sticky_get_all(self.conf) self.assertEqual(len(stickies), 1)
def test_sticky_destroy_by_sf_id(self): values = get_fake_sticky("1") sticky_ref1 = db_api.sticky_create(self.conf, values) values = get_fake_sticky("2") sticky_ref2 = db_api.sticky_create(self.conf, values) db_api.sticky_destroy_by_sf_id(self.conf, "1") stickies = db_api.sticky_get_all(self.conf) self.assertEqual([dict(sticky_ref2.iteritems())], [dict(st.iteritems()) for st in stickies])
def test_sticky_get_all(self): values = get_fake_sticky('1') db_api.sticky_create(self.conf, values) db_api.sticky_create(self.conf, values) stickies = db_api.sticky_get_all(self.conf) self.assertEqual(len(stickies), 2)