Exemplo n.º 1
0
 def test_post_with_force_update(self, mock_patch, mock_post):
     body = {
         'extra': 'extra',
         'base': {
             'contacts': {
                 'email': '*****@*****.**'
             }
         }
     }
     c = Customer.from_dict(node=self.node, attributes=body)
     posted = c.post(force_update=True)
     mock_patch.assert_called_with(self.base_url_customer + '/01',
                                   headers=self.headers_expected,
                                   json=body)
Exemplo n.º 2
0
 def test_from_dict_no_props(self):
     c = Customer.from_dict(node=self.node)
     assert c.attributes == {}, c.attributes
     prop = {}
     c = Customer.from_dict(node=self.node, attributes=prop)
     assert c.attributes is prop, c.attributes