def coll123_create_data(site): coll1 = Collection.create(site, "coll1", collection_create_values("coll1")) coll2 = Collection.create(site, "coll2", collection_create_values("coll2")) coll3 = Collection.create(site, "coll3", collection_create_values("coll3")) # for coll in [coll1, coll2, coll3]: type1 = RecordType.create( coll, "type1", recordtype_create_values(coll._entityid, "type1")) view1 = RecordView.create( coll, "view1", recordview_create_values(coll._entityid, "view1")) list1 = RecordList.create( coll, "list1", recordlist_create_values(coll._entityid, "list1")) data1 = RecordTypeData.create(coll, "type1", {}) type2 = RecordType.create( coll, "type2", recordtype_create_values(coll._entityid, "type2")) view2 = RecordView.create( coll, "view2", recordview_create_values(coll._entityid, "view2")) list2 = RecordList.create( coll, "list2", recordlist_create_values(coll._entityid, "list2")) data2 = RecordTypeData.create(coll, "type2", {}) # for t, d in [(type1, data1), (type2, data2)]: for eid in ["entity1", "entity2", "entity3"]: e = EntityData.create(d, eid, entitydata_create_values(coll, t, eid)) return
def setUp(self): init_annalist_test_site() self.testsite = Site(TestBaseUri, TestBaseDir) self.testcoll = Collection.create(self.testsite, "testcoll", collection_create_values("testcoll")) self.testtype = RecordType.create(self.testcoll, "testtype", recordtype_create_values("testtype")) self.testdata = RecordTypeData.create(self.testcoll, "testtype", {}) # Create view with duplicate field id self.viewdata = recordview_create_values(view_id="DupField_view") recordview_values_add_field(self.viewdata, field_id="Entity_comment", field_placement="small:0,12") recordview_values_add_field(self.viewdata, field_id="Entity_comment", field_property_uri="rdfs:comment_alt", field_placement="small:0,12") self.testview = RecordView.create(self.testcoll, "DupField_view", self.viewdata) # Login and permissions create_test_user(self.testcoll, "testuser", "testpassword") self.client = Client(HTTP_HOST=TestHost) loggedin = self.client.login(username="******", password="******") self.assertTrue(loggedin) return
def _create_record_view(self, view_id): "Helper function creates record view entry with supplied view_id" t = RecordView.create( self.testcoll, view_id, recordview_create_values(view_id=view_id, view_entity_type="annal:View")) return t
def setUp(self): init_annalist_test_site() self.testsite = Site(TestBaseUri, TestBaseDir) self.testcoll = Collection.create(self.testsite, "testcoll", collection_create_values("testcoll")) self.testtype = RecordType.create(self.testcoll, "testtype", recordtype_create_values("testtype")) self.testdata = RecordTypeData.create(self.testcoll, "testtype", {}) # Create view with duplicate field id self.viewdata = recordview_create_values(view_id="DupField_view") recordview_values_add_field( self.viewdata, field_id="Entity_comment", field_placement="small:0,12" ) recordview_values_add_field( self.viewdata, field_id="Entity_comment", field_property_uri="rdfs:comment_alt", field_placement="small:0,12" ) self.testview = RecordView.create(self.testcoll, "DupField_view", self.viewdata) # Login and permissions create_test_user(self.testcoll, "testuser", "testpassword") self.client = Client(HTTP_HOST=TestHost) loggedin = self.client.login(username="******", password="******") self.assertTrue(loggedin) return
def _create_record_view(self, view_id): "Helper function creates record view entry with supplied view_id" t = RecordView.create( self.testcoll, view_id, recordview_create_values(view_id=view_id, target_record_type="annal:View") ) return t
def setUp(self): init_annalist_test_site() self.testsite = Site(TestBaseUri, TestBaseDir) self.testcoll = Collection(self.testsite, "testcoll") self.coll1 = collection_values("coll1") self.testcoll_add = collection_create_values("testcoll") self.type1_add = recordtype_create_values("testcoll", "type1") self.type1 = recordtype_read_values("testcoll", "type1") self.type2_add = recordtype_create_values("testcoll", "type2") self.type2 = recordtype_read_values("testcoll", "type2") self.view1_add = recordview_create_values("testcoll", "view1") self.view1 = recordview_read_values("testcoll", "view1") self.view2_add = recordview_create_values("testcoll", "view2") self.view2 = recordview_read_values("testcoll", "view2") self.list1_add = recordlist_create_values("testcoll", "list1") self.list1 = recordlist_read_values("testcoll", "list1") self.list2_add = recordlist_create_values("testcoll", "list2") self.list2 = recordlist_read_values("testcoll", "list2") return
def setUp(self): init_annalist_test_site() init_annalist_test_coll() self.testsite = Site(TestBaseUri, TestBaseDir) self.testcoll = Collection(self.testsite, "testcoll") self.coll1 = collection_values("coll1") self.testcoll_add = collection_create_values("testcoll") self.type1_add = recordtype_create_values("testcoll", "type1") self.type1 = recordtype_read_values("testcoll", "type1") self.type2_add = recordtype_create_values("testcoll", "type2") self.type2 = recordtype_read_values("testcoll", "type2") self.view1_add = recordview_create_values("testcoll", "view1") self.view1 = recordview_read_values("testcoll", "view1") self.view2_add = recordview_create_values("testcoll", "view2") self.view2 = recordview_read_values("testcoll", "view2") self.list1_add = recordlist_create_values("testcoll", "list1") self.list1 = recordlist_read_values("testcoll", "list1") self.list2_add = recordlist_create_values("testcoll", "list2") self.list2 = recordlist_read_values("testcoll", "list2") return