def test_QueryDict(self): qd = QueryDict() self.assertTrue(isinstance(qd, dict)) # __setattr__ qd.toto = 1 self.assertEqual(qd.get('toto'), 1) # __getattr__ toto = qd.toto self.assertEqual(toto, 1)
def test_QueryDict(self): qd = QueryDict() self.assertTrue(isinstance(qd, dict)) # __setattr__ qd.toto = 1 self.assertEqual(qd.get('toto'), 1) # __getattr__ toto = qd.toto self.assertEqual(toto, 1) with self.assertRaises(AttributeError): foo = qd.not_an_attribute