

def test_dbref_hash(self):
    dbref_1a = DBRef('collection', 'id', 'database')
    dbref_1b = DBRef('collection', 'id', 'database')
    self.assertEqual(hash(dbref_1a), hash(dbref_1b))
    dbref_2a = DBRef('collection', 'id', 'database', custom='custom')
    dbref_2b = DBRef('collection', 'id', 'database', custom='custom')
    self.assertEqual(hash(dbref_2a), hash(dbref_2b))
    self.assertNotEqual(hash(dbref_1a), hash(dbref_2a))

dataset/ETHPy150Open mongodb/mongo-python-driver/test/test_dbref.py TestDBRef.test_dbref_hash/original