@@ -27,7 +27,7 @@ def test_index_view_with_endpoints(self):
27
27
response = self .client .get (reverse ('drfdocs' ))
28
28
29
29
self .assertEqual (response .status_code , 200 )
30
- self .assertEqual (len (response .context ["endpoints" ]), 10 )
30
+ self .assertEqual (len (response .context ["endpoints" ]), 11 )
31
31
32
32
# Test the login view
33
33
self .assertEqual (response .context ["endpoints" ][0 ].name_parent , "accounts" )
@@ -38,8 +38,16 @@ def test_index_view_with_endpoints(self):
38
38
self .assertEqual (response .context ["endpoints" ][0 ].fields [0 ]["type" ], "CharField" )
39
39
self .assertTrue (response .context ["endpoints" ][0 ].fields [0 ]["required" ])
40
40
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
+
41
49
# 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'" )
43
51
44
52
def test_index_search_with_endpoints (self ):
45
53
response = self .client .get ("%s?search=reset-password" % reverse ("drfdocs" ))
0 commit comments