File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -131,3 +131,25 @@ def test_device_polling_interval_can_be_changed(self):
131
131
"device_code" : "abc" ,
132
132
"interval" : 10 ,
133
133
}
134
+
135
+ def test_incorrect_client_id_sent (self ):
136
+ """
137
+ Ensure the correct error is returned when an invalid client is sent
138
+ """
139
+ request_data : dict [str , str ] = {
140
+ "client_id" : "client_id_that_does_not_exist" ,
141
+ }
142
+ request_as_x_www_form_urlencoded : str = urlencode (request_data )
143
+
144
+ response : django .http .response .JsonResponse = self .client .post (
145
+ reverse ("oauth2_provider:device-authorization" ),
146
+ data = request_as_x_www_form_urlencoded ,
147
+ content_type = "application/x-www-form-urlencoded" ,
148
+ )
149
+
150
+ assert response .status_code == 400
151
+
152
+ assert response .json () == {
153
+ "error" : "invalid_request" ,
154
+ "error_description" : "Invalid client_id parameter value." ,
155
+ }
You can’t perform that action at this time.
0 commit comments