def create_concept_authority():
    concept_authority = ConceptAuthority(
        host='http://chps.asu.edu/conceptpower/rest',
        name='ASU Conceptpower',
        queryformat='/ConceptLookup/{0}/{1}',
        retrieveformat='/Concept?id={0}',
        namespace='http://www.digitalhps.org')

    concept_authority.save()
    return concept_authority
Exemple #2
0
def create_concept_authority():
    concept_authority = ConceptAuthority(
        host='http://chps.asu.edu/conceptpower/rest',
        name='ASU Conceptpower',
        queryformat='/ConceptLookup/{0}/{1}',
        retrieveformat='/Concept?id={0}',
        namespace='http://www.digitalhps.org')
        
    concept_authority.save()
    return concept_authority
    def test_namespace_unique(self):
        """
        the namespace column must be unique
        """
        ca = ConceptAuthority(host='http://chps.asu.edu/conceptpower/rest',
                              name='ASU Conceptpower',
                              queryformat='/ConceptLookup/{0}/{1}',
                              retrieveformat='/Concept?id={0}',
                              namespace='http://www.digitalhps.org')
        ca.save()
        ca2 = ConceptAuthority(host='http://chps.asu.edu/conceptpower/rest',
                               name='ASU Conceptpower',
                               queryformat='/ConceptLookup/{0}/{1}',
                               retrieveformat='/Concept?id={0}',
                               namespace='http://www.digitalhps.org')

        self.assertRaises(IntegrityError, ca2.save)
Exemple #4
0
 def test_namespace_unique(self):
     """
     the namespace column must be unique
     """
     ca = ConceptAuthority(
         host='http://chps.asu.edu/conceptpower/rest',
         name='ASU Conceptpower',
         queryformat='/ConceptLookup/{0}/{1}',
         retrieveformat='/Concept?id={0}',
         namespace='http://www.digitalhps.org')
     ca.save()
     ca2 = ConceptAuthority(
         host='http://chps.asu.edu/conceptpower/rest',
         name='ASU Conceptpower',
         queryformat='/ConceptLookup/{0}/{1}',
         retrieveformat='/Concept?id={0}',
         namespace='http://www.digitalhps.org')
     
     self.assertRaises(IntegrityError, ca2.save)