python - How to run tests django rest framework tests? -


i'm learning django rest framework. wrote simple test this:

from rest_framework import status rest_framework.test import apitestcase   class clinictestcase(apitestcase):     def getlist(self):         factory = apirequestfactory()         request = factory.get('/clinic/')         self.assertequal(response.status_code, status.ok) 

my api returns empty json array request. don't know is, how run test?

when use command:

python manage.py test 

i get

ran 0 tests in 0.000s 

as output. it's not written in documentation how run tests.

i believe test methods need start test. change def getlist def testgetlist or def test_get_list.

as other python tests (see https://docs.python.org/2/library/unittest.html#basic-example), if methods not start test not run tests.


Comments

Popular posts from this blog

objective c - Deep Linking for iOS Apps which are not installed yet? -

Changing nested dictionary in VBA -

javascript - SignalR sharing connection between 2 apps -