Example #1
0
    def test_update_with_lists(self):
        org = AdJson()
        org.a = [1, 2, {'a': 'superman'}]
        someother = AdJson()
        someother.b = [{'b': 123}]
        org.update(someother)

        correct = {'a': [1, 2, {'a': 'superman'}],
                   'b': [{'b': 123}]}

        org.update(someother)
        self.assert_ad_json_equal(org, correct)
        self.assertIsInstance(org.b[0].to_dict(), dict)
Example #2
0
 def test_set_one_level_property(self):
     ad_json = AdJson()
     ad_json.a = self._test_list
     self.assert_ad_json_equal(ad_json, {'a': self._test_list})