@@ -27,7 +27,7 @@ def test_index_view_with_endpoints(self):
2727 response = self .client .get (reverse ('drfdocs' ))
2828
2929 self .assertEqual (response .status_code , 200 )
30- self .assertEqual (len (response .context ["endpoints" ]), 10 )
30+ self .assertEqual (len (response .context ["endpoints" ]), 11 )
3131
3232 # Test the login view
3333 self .assertEqual (response .context ["endpoints" ][0 ].name_parent , "accounts" )
@@ -38,8 +38,16 @@ def test_index_view_with_endpoints(self):
3838 self .assertEqual (response .context ["endpoints" ][0 ].fields [0 ]["type" ], "CharField" )
3939 self .assertTrue (response .context ["endpoints" ][0 ].fields [0 ]["required" ])
4040
41+ self .assertEqual (response .context ["endpoints" ][1 ].name_parent , "accounts" )
42+ self .assertEqual (response .context ["endpoints" ][1 ].allowed_methods , ['POST' , 'OPTIONS' ])
43+ self .assertEqual (response .context ["endpoints" ][1 ].path , "/accounts/login2/" )
44+ self .assertEqual (response .context ["endpoints" ][1 ].docstring , "A view that allows users to login providing their username and password. Without serializer_class" )
45+ self .assertEqual (len (response .context ["endpoints" ][1 ].fields ), 2 )
46+ self .assertEqual (response .context ["endpoints" ][1 ].fields [0 ]["type" ], "CharField" )
47+ self .assertTrue (response .context ["endpoints" ][1 ].fields [0 ]["required" ])
48+ 4149 # The view "OrganisationErroredView" (organisations/(?P<slug>[\w-]+)/errored/) should contain an error.
42- self .assertEqual (str (response .context ["endpoints" ][8 ].errors ), "'test_value'" )
50+ self .assertEqual (str (response .context ["endpoints" ][9 ].errors ), "'test_value'" )
4351
4452 def test_index_search_with_endpoints (self ):
4553 response = self .client .get ("%s?search=reset-password" % reverse ("drfdocs" ))
0 commit comments