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