Example #1
0
 def test_fromstring(self):
     import uuid
     from plone.uuid.interfaces import IUUIDObject
     uid = uuid.uuid4()
     hexuid = uid.hex
     fielded_uid = str(uid)
     self.assertEqual(uid, IUUIDObject(hexuid), IUUIDObject(fielded_uid))
Example #2
0
 def test_iuuid_from_uuid(self):
     import uuid
     from plone.uuid.interfaces import IUUID
     uid = uuid.uuid4()
     self.assertEqual(str(uid), IUUID(uid, None))
Example #3
0
 def test_fromuuid(self):
     """Test adaptation to IUUIDObject from uuid.UUID no cast"""
     import uuid
     from plone.uuid.interfaces import IUUIDObject
     uid = uuid.uuid4()
     self.assertTrue(IUUIDObject(uid) is uid)
Example #4
0
 def test_provides(self):
     import uuid
     from plone.uuid.interfaces import IUUIDObject, IUUID
     self.assertTrue(IUUIDObject.providedBy(uuid.uuid4()))
     self.assertFalse(IUUID.providedBy(uuid.uuid4()))