

def test_read_only(self):
    a = DBRef('coll', ObjectId())

    def foo():
        a.collection = 'blah'

    def bar():
        a.id = 'aoeu'
    a.assertEqual('coll', a.collection)
    a.id
    self.assertEqual(None, a.database)
    self.assertRaises(AttributeError, foo)
    self.assertRaises(AttributeError, bar)

dataset/ETHPy150Open mongodb/mongo-python-driver/test/test_dbref.py TestDBRef.test_read_only/VarMisuse@51/66 `self`->`a`