@@ -21,7 +21,7 @@ def test_settings_module(self):
21
21
22
22
def test_index_view_with_endpoints (self ):
23
23
"""
24
- Should load the drf focs view with all the endpoints.
24
+ Should load the drf docs view with all the endpoints.
25
25
NOTE: Views that do **not** inherit from DRF's "APIView" are not included.
26
26
"""
27
27
response = self .client .get (reverse ('drfdocs' ))
@@ -31,15 +31,15 @@ def test_index_view_with_endpoints(self):
31
31
32
32
# Test the login view
33
33
self .assertEqual (response .context ["endpoints" ][0 ].name_parent , "accounts" )
34
- self .assertEqual (response .context ["endpoints" ][0 ].allowed_methods , [ 'POST ' , 'OPTIONS' ] )
34
+ self .assertEqual (set ( response .context ["endpoints" ][0 ].allowed_methods ), set ([ 'OPTIONS ' , 'POST' ]) )
35
35
self .assertEqual (response .context ["endpoints" ][0 ].path , "/accounts/login/" )
36
36
self .assertEqual (response .context ["endpoints" ][0 ].docstring , "A view that allows users to login providing their username and password." )
37
37
self .assertEqual (len (response .context ["endpoints" ][0 ].fields ), 2 )
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
41
self .assertEqual (response .context ["endpoints" ][1 ].name_parent , "accounts" )
42
- self .assertEqual (response .context ["endpoints" ][1 ].allowed_methods , ['POST' , 'OPTIONS' ])
42
+ self .assertEqual (set ( response .context ["endpoints" ][1 ].allowed_methods ), set ( ['POST' , 'OPTIONS' ]) )
43
43
self .assertEqual (response .context ["endpoints" ][1 ].path , "/accounts/login2/" )
44
44
self .assertEqual (response .context ["endpoints" ][1 ].docstring , "A view that allows users to login providing their username and password. Without serializer_class" )
45
45
self .assertEqual (len (response .context ["endpoints" ][1 ].fields ), 2 )
@@ -77,7 +77,7 @@ def test_model_viewset(self):
77
77
self .assertEqual (response .context ['endpoints' ][6 ].fields [2 ]['to_many_relation' ], True )
78
78
self .assertEqual (response .context ["endpoints" ][11 ].path , '/organisation-model-viewsets/' )
79
79
self .assertEqual (response .context ["endpoints" ][12 ].path , '/organisation-model-viewsets/<pk>/' )
80
- self .assertEqual (response .context ["endpoints" ][11 ].allowed_methods , ['GET' , 'POST' , 'OPTIONS' ])
81
- self .assertEqual (response .context ["endpoints" ][12 ].allowed_methods , ['GET' , 'PUT' , 'PATCH' , 'DELETE' , 'OPTIONS' ])
82
- self .assertEqual (response .context ["endpoints" ][13 ].allowed_methods , ['POST' , 'OPTIONS' ])
80
+ self .assertEqual (set ( response .context ["endpoints" ][11 ].allowed_methods ), set ( ['GET' , 'POST' , 'OPTIONS' ]) )
81
+ self .assertEqual (set ( response .context ["endpoints" ][12 ].allowed_methods ), set ( ['GET' , 'PUT' , 'PATCH' , 'DELETE' , 'OPTIONS' ]) )
82
+ self .assertEqual (set ( response .context ["endpoints" ][13 ].allowed_methods ), set ( ['POST' , 'OPTIONS' ]) )
83
83
self .assertEqual (response .context ["endpoints" ][13 ].docstring , 'This is a test.' )
0 commit comments