def METHOD_NAME(self):
    with dbm.ndbm.open(self.filename, 'c') as db:
        db['Unicode key \U0001f40d'] = 'Unicode value \U0001f40d'
    with dbm.ndbm.open(self.filename, 'r') as db:
        self.assertEqual(list(db.keys()), ['Unicode key \U0001f40d'.encode()])
        self.assertTrue('Unicode key \U0001f40d'.encode() in db)
        self.assertTrue('Unicode key \U0001f40d' in db)
        self.assertEqual(db['Unicode key \U0001f40d'.encode()],
                         'Unicode value \U0001f40d'.encode())
        self.assertEqual(db['Unicode key \U0001f40d'],
                         'Unicode value \U0001f40d'.encode())