Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated djangoproject.com documentation builder to work with the regr…

…ession tests added in [3176]

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@3190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2dee641054c916fefc518c545c52dd6fc4d34cd9 1 parent 819d763
authored June 21, 2006
10  django_website/apps/docs/parts/build_documentation.py
@@ -25,13 +25,13 @@
25 25
 {{ blurb }}
26 26
 
27 27
 <h2 id="model-source-code">Model source code</h2>
28  
-<pre class="literal-block">{{ model_source }}</pre>
  28
+<pre class="literal-block">{{ model_source|escape }}</pre>
29 29
 
30 30
 <h2 id="sample-usage">Sample API usage</h2>
31 31
 <p>This sample code assumes the above model{{ models|pluralize }} {% if models|pluralize %}have{% else %}has{% endif %}
32 32
 been saved in a file <tt class="docutils literal"><span class="pre">mysite/models.py</span></tt>.
33 33
 <pre class="literal-block">&gt;&gt;&gt; from mysite.models import {% for model in models %}{{ model.name }}{% if not forloop.last %}, {% endif %}{% endfor %}
34  
-{{ api_usage }}</pre>
  34
+{{ api_usage|escape }}</pre>
35 35
 </div>
36 36
 """
37 37
 
@@ -69,12 +69,14 @@ def build_test_documents():
69 69
     settings.INSTALLED_APPS
70 70
 
71 71
     # Manually set INSTALLED_APPS to point to the test models.
72  
-    settings.INSTALLED_APPS = runtests.ALWAYS_INSTALLED_APPS + [runtests.MODEL_TESTS_DIR_NAME + '.' + a for a in runtests.get_test_models()]
  72
+    test_apps = [runtests.MODEL_TESTS_DIR_NAME + '.' + app for (loc, app) in runtests.get_test_models() if loc != runtests.REGRESSION_TESTS_DIR_NAME]
  73
+    settings.INSTALLED_APPS = runtests.ALWAYS_INSTALLED_APPS + test_apps
73 74
 
74 75
     # Some of the test models need to know whether the docs are being built.
75 76
     settings.BUILDING_DOCS = True
76 77
 
77  
-    for model_name in runtests.get_test_models():
  78
+    for app_name in test_apps:
  79
+        model_name = app_name.split(".")[-1]
78 80
         mod = get_app(model_name)
79 81
 
80 82
         out_file = os.path.join(settings.DJANGO_DOCUMENT_ROOT_PATH, 'model_' + model_name + '.html')

0 notes on commit 2dee641

Please sign in to comment.
Something went wrong with that request. Please try again.