Ejemplo n.º 1
0
    def test_box_descriptor(self):
        b = Box()
        self.assertTrue(b.descriptor is None, "Descriptor not initialized to None.")

        p = Page()
        p.title = 'Testbox 1'
        p.data = 'This Page is used as the descriptor for Testbox 1.'
        p.save()

        b.descriptor = p
        b.save()
        self.assertTrue(b.descriptor == p, "Descriptor not saved.")
        self.assertTrue(p.describes_box == b, "Descriptor does not point back to box.")