Add simple test for credentials list, should not allow POST (for now).

This commit is contained in:
Chris Church
2013-05-10 11:13:57 -04:00
parent bae177460b
commit 8f2ea04b48
2 changed files with 24 additions and 0 deletions

View File

@@ -41,6 +41,12 @@ class BaseList(generics.ListCreateAPIView):
# model = ModelClass
# serializer_class = SerializerClass
def post(self, request, *args, **kwargs):
postable = getattr(self.__class__, 'postable', True)
if not postable:
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
return super(BaseList, self).post(request, *args, **kwargs)
def get_queryset(self):
base = self._get_queryset()