Esempio n. 1
0
    def test_resolve(self):
        c = Concept(uri="http://www.digitalhps.org/concepts/CONe5b55803-1ef6-4abe-b81c-1493e97421df",
                    authority="ConceptpowerAuthority")
        c.save()

        resolve(Concept, c)
        resolve(Type, c.typed)

        self.assertTrue(hasattr(c, 'typed'))
        self.assertFalse(c.typed is None)
        self.assertTrue(c.resolved)
        self.assertTrue(c.typed.resolved)
        self.assertEqual(c.pos, 'noun')
Esempio n. 2
0
    def test_resolve(self):
        c = Concept(uri="http://www.digitalhps.org/concepts/CONe5b55803-1ef6-4abe-b81c-1493e97421df",
                    authority="ConceptpowerAuthority")
        c.save()

        resolve(Concept, c)
        resolve(Type, c.typed)

        self.assertTrue(hasattr(c, 'typed'))
        self.assertFalse(c.typed is None)
        self.assertTrue(c.resolved)
        self.assertTrue(c.typed.resolved)
        self.assertEqual(c.pos, 'noun')
Esempio n. 3
0
def resolve_concept(sender, instance):
    try:
        resolve(sender, instance)
    except requests.exceptions.ConnectionError:
        pass