def setUp(self): super(CollectionsApiTestCase, self).setUp() self.rolex = self.create_user(foreign_id='user_3') self.col = Collection() self.col.label = 'Test Collection' self.col.foreign_id = 'test_coll_entities_api' db.session.add(self.col) db.session.flush() self.ent = Entity() self.ent.collection = self.col self.ent.update({'name': 'Winnie the Pooh'}) db.session.add(self.ent) db.session.commit()
def setUp(self): super(EntitiesApiTestCase, self).setUp() self.rolex = self.create_user(foreign_id='user_3') self.col = Collection() self.col.label = 'Test Collection' self.col.foreign_id = 'test_coll_entities_api' db.session.add(self.col) db.session.flush() self.ent = Entity() self.ent.collections = [self.col] self.ent.update({ 'name': 'Winnie the Pooh', 'jurisdiction_code': 'pa', 'identifiers': [{ 'scheme': 'wikipedia', 'identifier': 'en:Winnie-the-Pooh' }] }) db.session.add(self.ent) db.session.commit()