File tree Expand file tree Collapse file tree 5 files changed +12
-7
lines changed
Expand file tree Collapse file tree 5 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def get_item_by_id(self, identity):
2424
2525class AssetSchema (BaseSchema ):
2626 status = fields .Str ()
27- external_id = fields .Int ()
27+ external_id = fields .Str ()
2828 external_uid = fields .UUID ()
2929 product = fields .Nested (ProductSchema , only = ('id' , 'name' ))
3030 connection = fields .Nested (
Original file line number Diff line number Diff line change @@ -24,4 +24,4 @@ def make_object(self, data):
2424
2525class HubsSchemaMixin (Schema ):
2626 hub = fields .Nested (HubSchema , only = ('id' , 'name' ))
27- external_id = fields .Int ()
27+ external_id = fields .Str ()
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class Tier(BaseModel):
1818class TierSchema (BaseSchema ):
1919 name = fields .Str ()
2020 contact_info = fields .Nested (ContactInfoSchema )
21- external_id = fields .Int ()
21+ external_id = fields .Str ()
2222 external_uid = fields .UUID ()
2323
2424 @post_load
Original file line number Diff line number Diff line change 1313 "name" : " Marc FSG"
1414 }
1515 },
16- "external_id" : 899 ,
16+ "external_id" : " 899" ,
1717 "id" : " AS-893-495-635-9" ,
1818 "items" : [
1919 {
105105 "postal_code" : " 30690" ,
106106 "state" : " Nevada"
107107 },
108- "external_id" : 889 ,
108+ "external_id" : " 889" ,
109109 "id" : " TA-0-5870-9239-0029" ,
110110 "name" : " Kaiser LLC"
111111 },
129129 "postal_code" : " 12111" ,
130130 "state" : " Alaska"
131131 },
132- "external_id" : 1 ,
132+ "external_id" : " 1 " ,
133133 "id" : " TA-0-7251-3930-7482" ,
134134 "name" : " ACME Reseller"
135135 },
Original file line number Diff line number Diff line change @@ -75,7 +75,12 @@ def test_create_model_from_response():
7575 assert request_obj .marketplace .id == content ['marketplace' ]['id' ]
7676 assert request_obj .asset .id == content ['asset' ]['id' ]
7777 assert request_obj .asset .product .id == content ['asset' ]['product' ]['id' ]
78- assert isinstance (request_obj .asset .external_id , int )
78+ try :
79+ # Python 2
80+ assert isinstance (request_obj .asset .external_id , basestring )
81+ except NameError :
82+ # Python 3
83+ assert isinstance (request_obj .asset .external_id , str )
7984
8085
8186@patch ('requests.get' , MagicMock (return_value = _get_response2_ok ()))
You can’t perform that action at this time.
0 commit comments