Exemplo n.º 1
0
    def testTraversal(self):
        a = Article()
        i = Issue()
        p = Periodical()
        pr = Person()
        eg = EditorGroup()

        eg.periodical = p
        pr.name = "John Malcovitshy"
        p.title = "Periodicaltitle"
        eg.members = [pr]

        a.issue = i
        i.periodical = p
        a.makers = [pr]
        self.assertEqual(a.issue.periodical.title, "Periodicaltitle")
        self.assertEqual(a.makers[0].name, "John Malcovitshy")
        self.assertEqual(eg.members[0].name, "John Malcovitshy")
        self.assertEqual(eg.periodical.title, "Periodicaltitle")
        self.assertEqual(12, len(self.graph))
Exemplo n.º 2
0
 def testPerson(self):
     p = Person()
     p.name = "John Malcovitshy"
     self.assertEqual(2, len(self.graph))
     self.assertEqual("http://localhost:5000/entity/john-malcovitshy", p.locUrl)