@@ -36,6 +36,7 @@ def test_lists(resps):
3636 lists = facade ._get_lists ()
3737 assert lists == {
3838 'Python Pro' : '1' , 'Python Birds' : '2' , 'Pytools' : '3' , 'Prospects' : '4' , 'Plantão de Dúvidas' : '5' ,
39+ 'Usuários Ativos' : '12'
3940 }
4041
4142
@@ -69,15 +70,22 @@ def resps_user_not_found(setup_active_settings):
6970 ),
7071 json = _user_editon_ok , status = 200
7172 )
73+ r .add (
74+ r .POST ,
75+ (
76+ 'https://foo.pythonhosted.com/api/3/contactLists'
77+ ),
78+ json = _user_editon_ok , status = 200
79+ )
7280
7381 yield r
7482
7583
7684def test_client_creation_user_not_found (resps_user_not_found , grant_role_mock ):
7785 facade .create_or_update_client ('Renzo Nuccitelli' , 'renzo@python.pro.br' , 'turma' , id = 1 )
7886 body_payload = (
79- 'email=renzo%40python.pro.br&first_name=Renzo&tags=turma&field%5B%25 '
80- 'PYTHONPRO_ID%25%5D=0000000001&p%5B4 %5D=4&status=1 '
87+ 'email=renzo%40python.pro.br&first_name=Renzo&tags=turma&p%5B4%5D=4&status=1 '
88+ '&field%5B%25PYTHONPRO_ID%25 %5D=0000000001 '
8189 )
8290 assert resps_user_not_found .calls [2 ].request .body == body_payload
8391
@@ -120,15 +128,22 @@ def resps_user_found(setup_active_settings):
120128 ),
121129 json = _user_editon_ok , status = 200
122130 )
131+ r .add (
132+ r .POST ,
133+ (
134+ 'https://foo.pythonhosted.com/api/3/contactLists'
135+ ),
136+ json = _user_editon_ok , status = 200
137+ )
123138
124139 yield r
125140
126141
127142def test_client_creation_user_found (resps_user_found , grant_role_mock ):
128143 facade .create_or_update_client ('Renzo Nuccitelli' , 'renzo@python.pro.br' , 'turma' , id = 1 )
129144 body_payload = (
130- 'email=renzo%40python.pro.br&first_name=Renzo&tags=turma&field%5B%25 '
131- 'PYTHONPRO_ID%25%5D=0000000001&p%5B4 %5D=4&status=1 &id=1'
145+ 'email=renzo%40python.pro.br&first_name=Renzo&tags=turma&p%5B4%5D=4&status=1 '
146+ '&field%5B%25PYTHONPRO_ID%25 %5D=0000000001 &id=1'
132147 )
133148 assert resps_user_found .calls [2 ].request .body == body_payload
134149
@@ -157,15 +172,22 @@ def resps_two_users_found(setup_active_settings):
157172 ),
158173 json = _user_editon_ok , status = 200
159174 )
175+ r .add (
176+ r .POST ,
177+ (
178+ 'https://foo.pythonhosted.com/api/3/contactLists'
179+ ),
180+ json = _user_editon_ok , status = 200
181+ )
160182
161183 yield r
162184
163185
164186def test_client_creation_two_users_found (resps_two_users_found , grant_role_mock ):
165187 facade .create_or_update_client ('Renzo Nuccitelli' , 'renzo@python.pro.br' , 'turma' , id = 1 )
166188 body_payload = (
167- 'email=renzo%40python.pro.br&first_name=Renzo&tags=turma&field%5B%25 '
168- 'PYTHONPRO_ID%25%5D=0000000001&p%5B4 %5D=4&status=1 '
189+ 'email=renzo%40python.pro.br&first_name=Renzo&tags=turma&p%5B4%5D=4&status=1 '
190+ '&field%5B%25PYTHONPRO_ID%25 %5D=0000000001 '
169191 )
170192 assert resps_two_users_found .calls [2 ].request .body == body_payload
171193
@@ -249,6 +271,10 @@ def test_granted_client_role(resps_user_found, grant_role_mock):
249271 'id' : '5' , 'name' : 'Plantão de Dúvidas' , 'cdate' : '2019-12-06 15:28:51' , 'private' : '0' , 'userid' : '1' ,
250272 'subscriber_count' : 0
251273 },
274+ '5' : {
275+ 'id' : '12' , 'name' : 'Usuários Ativos' , 'cdate' : '2020-06-06 15:28:51' , 'private' : '0' , 'userid' : '1' ,
276+ 'subscriber_count' : 0
277+ },
252278 'result_code' : 1 ,
253279 'result_message' : 'Sucesso:algo retornou' ,
254280 'result_output' : 'json'
0 commit comments