def test_expand_rel(self): # should work on namespaced and internal rels self.assertEqual(DocumentSchema.expand_rel(self.internal_schema_name), '%s%s'%(DocumentSchema.DEFAULT_REL_NAMESPACE, self.internal_schema_name)) self.assertEqual(DocumentSchema.expand_rel(self.external_schema_name), self.external_schema_name)
def test_expand_rel(self): # should work on namespaced and internal rels self.assertEqual( DocumentSchema.expand_rel(self.internal_schema_name), '%s%s' % (DocumentSchema.DEFAULT_REL_NAMESPACE, self.internal_schema_name)) self.assertEqual(DocumentSchema.expand_rel(self.external_schema_name), self.external_schema_name)
def setUp(self): super(DocumentSchemaModelUnitTests, self).setUp() # An existing schema self.schema = DocumentSchema.objects.get(type=DocumentSchema.expand_rel('annotation')) self.internal_schema_name = 'new_internal_schema' self.external_schema_name = 'http://mysweetdomain.com/schemas#new_external_schema'
def setUp(self): super(DocumentSchemaModelUnitTests, self).setUp() # An existing schema self.schema = DocumentSchema.objects.get( type=DocumentSchema.expand_rel('annotation')) self.internal_schema_name = 'new_internal_schema' self.external_schema_name = 'http://mysweetdomain.com/schemas#new_external_schema'
def setUp(self): super(DocumentRelsModelUnitTests, self).setUp() # A record self.record = self.createRecord(TEST_RECORDS, 0) # A couple test docs self.r_doc1 = self.createDocument(TEST_R_DOCS, 2, record=self.record) self.r_doc2 = self.createDocument(TEST_R_DOCS, 10, record=self.record) self.relationship = DocumentSchema.objects.get(type=DocumentSchema.expand_rel('annotation'))
def test_construction(self): # Should be able to construct normally # Note: not testing the stylesheet attribute because this is highly broken try: ds = DocumentSchema(type=self.internal_schema_name, stylesheet=None, internal_p=False) except: self.fail( 'Unable to construct documentschema with standard arguments')
def setUp(self): super(DocumentRelsModelUnitTests, self).setUp() # A record self.record = self.createRecord(TEST_RECORDS, 0) # A couple test docs self.r_doc1 = self.createDocument(TEST_R_DOCS, 2, record=self.record) self.r_doc2 = self.createDocument(TEST_R_DOCS, 10, record=self.record) self.relationship = DocumentSchema.objects.get( type=DocumentSchema.expand_rel('annotation'))