开发者

How do I set up gaeunit 2.0a with my Django app?

I am trying to set up Google App Engine unit testing for my web application. I downloaded the file from here.

I followed the instructions in the readmen by copying the directory gaeunit into the directory with the rest of my apps and registering 'gaeunit' in settings.py. This didn't seem sufficient to actually get things going. I also stuck url('^test(.*)', include('gaeunit.urls')) into my urls.py file.

When I go to the url http://开发者_StackOverflow社区localhost:8000/test, I get the following error:

[Errno 2] No such file or directory: '../../gaeunit/test'

Any suggestions? I'm not sure what I've done wrong. Thanks!


You can copy url but in your urls.py include

(r'^test', include('gaeunit.urls')), 

Also you will have to change test path in gaeunit.py

_LOCAL_DJANGO_TEST_DIR = 'test'

And in your main web test files under test folder include following line for django test setup

self.application = django.core.handlers.wsgi.WSGIHandler()


According to the instructions on the main page you should add the URL to app.yaml, not urls.py.

- url: /test.*
  script: gaeunit.py
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜