Djangorecipe test team

I have a question about testing my Django applications in an embedded Django project.

Firstly, I have not built the same project, and everything works fine. This project follows the standard architecture of the Django project, in addition to putting my tests into their own directory:

django_project/
  manage.py
  settings.py
  urls.py
  app1/
    models.py
    views.py
    urls.py
    tests/
  app2/
    ...

If I run tests in this situation, do it!

This is all a little different when it comes to the build environment. There I tried to check my project and applications and make the paths for all of them available in my bin directory (and I hope this also means that it is available for any magic djangorecipe). In any case, it looks like this:

[buildout]                                         
parts =
  django_project
  app1
  app2
  django

extra-paths =             
  ${buildout:directory}                
  ${buildout:directory}/parts    
  ${buildout:directory}/parts/django_project
  ${buildout:directory}/parts/app1
  ${buildout:directory}/parts/app2

[django_project]
recipe = infrae.subversion
urls = 
  https://svn/django_projects/trunk/ .

[app1]                     
recipe = infrae.subversion                           
urls 
  = https://svn/path/app1/trunk/ .

[app2]                     
recipe = infrae.subversion                             
urls = 
  https://svn/path/app2/trunk/ .

[django]                          
recipe = djangorecipe                         
version = 1.2             
project = django_project          
projectegg = django_project                         
wsgi=true                             
settings=settings
extra-paths = ${buildout:extra-paths}          
test =
  app1
  app2

When I run buildout, I get the following directory tree.

django_buidout/
  ...
  bin/
    django
    django.wsgi
    test
  parts/
    django/
    django_project/
      __init__.py
      settings.py
      ...
    app1/
      setup.py
      app1/
        __init__.py
        tests/
    app2/
      setup.py
      app2/
        __init__.py
        tests/

django, . . /bin/test, ImportError: No django.project.urls. (- my django_project.settings.URL_CONF = django_project.urls) , , django_project.urls. , . /bin/django test1, . app1 , .

views urlresolvers.reverse traceback django.tests Client().

- , urlresolvers.reverse , ?

,

Todd

+3

Source: https://habr.com/ru/post/1755006/


All Articles