def test_subscriber_add(self): rd = Random_Data() self.email = '{0}@{1}.com'.format(rd.id_generator(), rd.id_generator()) r = json.loads(self.s.add(self.email)) self.assertEqual(r['created'], True) self.document_id = r['_id'] sleep(self.sleep_in_sec) self.assertEqual(self.s.exists(self.email), True)
def test_category_add(self): rd = Random_Data() self.category_name = '{0}'.format(rd.id_generator()) r = json.loads(self.s.add(self.category_id, self.category_name)) self.assertEqual(r['created'], True) self.document_id = r['_id'] sleep(self.sleep_in_sec) self.assertEqual(self.s.exists_by_category_name(self.category_name), True)