Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)