def test_manual_assignment(self): """Establish that manual UUID assignment works as documented.""" legolas = Elf(name='Legolas Greenleaf') legolas.id = '01234567-abcd-abcd-abcd-0123456789ab' self.assertEqual( legolas.id, uuid.UUID('01234567-abcd-abcd-abcd-0123456789ab')) self.assertEqual(type(legolas.id), uuid.UUID)
def test_manual_assignment(self): """Establish that manual UUID assignment works as documented.""" legolas = Elf(name='Legolas Greenleaf') legolas.id = '01234567-abcd-abcd-abcd-0123456789ab' self.assertEqual(legolas.id, uuid.UUID('01234567-abcd-abcd-abcd-0123456789ab')) self.assertEqual(type(legolas.id), uuid.UUID)
def test_save(self): """Estblish that UUIDs are automatically created as documented.""" legolas = Elf(name='Legolas Greenleaf') self.assertEqual(legolas.id, '') legolas.save() assert isinstance(legolas.id, uuid.UUID)