def test_media_file_hash(self):
        name = "screenshot.png"
        media_file = os.path.join(
            self.this_directory, 'fixtures', 'transportation', name)
        m = MetaData.objects.create(
            data_type='media', xform=self.xform, data_value=name,
            data_file=File(open(media_file), name),
            data_file_type='image/png')
        f = open(media_file)
        media_hash = 'md5:%s' % hashlib.md5(f.read()).hexdigest()
        f.close()
        meta_hash = m.hash
        self.assertEqual(meta_hash, media_hash)
        self.assertEqual(m.file_hash, media_hash)
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/main/tests/test_form_metadata.py/TestFormMetadata.test_media_file_hash/original