Esempio n. 1
0
 def test_from_native(self):
     d = DataURLImageField().from_native('data:image/gif;base64,' +
                                         IMAGE_DATA)
     eq_(d.read(), IMAGE_DATA.decode('base64'))
Esempio n. 2
0
 def test_from_native(self):
     data, hash_ = DataURLImageField().from_native(
         'data:image/gif;base64,' + IMAGE_DATA)
     eq_(hash_, hashlib.md5(IMAGE_DATA.decode('base64')).hexdigest()[:8])
     eq_(data.read(), IMAGE_DATA.decode('base64'))
Esempio n. 3
0
 def test_from_native(self):
     d = DataURLImageField().from_native("data:image/gif;base64," + IMAGE_DATA)
     eq_(d.read(), IMAGE_DATA.decode("base64"))
Esempio n. 4
0
 def test_from_native(self):
     data, hash_ = DataURLImageField().from_native("data:image/gif;base64," + IMAGE_DATA)
     eq_(hash_, hashlib.md5(IMAGE_DATA.decode("base64")).hexdigest()[:8])
     eq_(data.read(), IMAGE_DATA.decode("base64"))