← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/maas/maas-cleanups into lp:maas

 

Raphaël Badin has proposed merging lp:~rvb/maas/maas-cleanups into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rvb/maas/maas-cleanups/+merge/90065

This branch does things:
- use the new style url tag (https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi)
- use nose to run tests.
-- 
https://code.launchpad.net/~rvb/maas/maas-cleanups/+merge/90065
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/maas/maas-cleanups into lp:maas.
=== modified file 'buildout.cfg'
--- buildout.cfg	2012-01-24 22:50:32 +0000
+++ buildout.cfg	2012-01-25 10:18:29 +0000
@@ -18,6 +18,7 @@
 eggs =
   django
   django-debug-toolbar
+  django-nose
   django-piston
   fixtures
   oops

=== modified file 'src/maas/development.py'
--- src/maas/development.py	2012-01-24 15:25:49 +0000
+++ src/maas/development.py	2012-01-25 10:18:29 +0000
@@ -165,6 +165,7 @@
     'maasserver',
     'maastesting',
     'debug_toolbar',
+    'django_nose',
 )
 
 # A sample logging configuration. The only tangible logging

=== modified file 'src/maas/settings.py'
--- src/maas/settings.py	2012-01-24 18:30:38 +0000
+++ src/maas/settings.py	2012-01-25 10:18:29 +0000
@@ -12,6 +12,14 @@
 
 import os
 
+# Use new style url tag:
+# https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi
+import django.template
+
+
+django.template.add_to_builtins('django.templatetags.future')
+
+TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
 
 ADMINS = (
     # ('Your Name', 'your_email@xxxxxxxxxxx'),
@@ -161,6 +169,7 @@
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'django.contrib.admin',
+    'django_nose',
     'maasserver',
     # Uncomment the next line to enable admin documentation:
     # 'django.contrib.admindocs',

=== modified file 'src/maasserver/templates/maasserver/base.html'
--- src/maasserver/templates/maasserver/base.html	2012-01-24 08:36:41 +0000
+++ src/maasserver/templates/maasserver/base.html	2012-01-25 10:18:29 +0000
@@ -20,10 +20,10 @@
       {% block header %}
         <ul id="main-nav" class="nav">
           <li class="{% block nav-active-index %}{% endblock %}">
-            <a href="{% url index %}">Dashboard</a>
+            <a href="{% url 'index' %}">Dashboard</a>
           </li>
           <li class="{% block nav-active-node-list %}{% endblock %}">
-            <a href="{% url node-list %}">Nodes</a>
+            <a href="{% url 'node-list' %}">Nodes</a>
          </li>
         </ul>
         <h1>MaaS Cluster</h1>

=== modified file 'src/maasserver/templates/maasserver/index.html'
--- src/maasserver/templates/maasserver/index.html	2012-01-24 13:36:35 +0000
+++ src/maasserver/templates/maasserver/index.html	2012-01-25 10:18:29 +0000
@@ -7,5 +7,5 @@
   {{ node_list|length }} node{{ node_list|length|pluralize }} in this cluster
   </h2>
 
-  <a href="{% url node-create %}">Add Node</a>
+  <a href="{% url 'node-create' %}">Add Node</a>
 {% endblock %}

=== modified file 'src/maasserver/templates/maasserver/node_list.html'
--- src/maasserver/templates/maasserver/node_list.html	2012-01-24 17:21:45 +0000
+++ src/maasserver/templates/maasserver/node_list.html	2012-01-25 10:18:29 +0000
@@ -24,5 +24,5 @@
       {% endfor %}
     </table>
   {% endif%}
-  <a href="{% url node-create %}">Add Node</a>
+  <a href="{% url 'node-create' %}">Add Node</a>
 {% endblock %}

=== modified file 'src/maasserver/templates/maasserver/user-nav.html'
--- src/maasserver/templates/maasserver/user-nav.html	2012-01-24 08:42:22 +0000
+++ src/maasserver/templates/maasserver/user-nav.html	2012-01-25 10:18:29 +0000
@@ -1,8 +1,9 @@
+{% load url from future %}
 <ul id="user-nav" class="nav">
   {% if user.is_authenticated %}
-    <li><a href="{% url logout %}">Logout</a></li>
+    <li><a href="{% url 'logout' %}">Logout</a></li>
     <li>{{ user.username }}</li>
   {% else %}
-    <li><a href="{% url login %}">Login</a></li>
+    <li><a href="{% url 'login' %}">Login</a></li>
   {% endif %}
 </ul>

=== modified file 'src/maastesting/runner.py'
--- src/maastesting/runner.py	2012-01-24 12:44:48 +0000
+++ src/maastesting/runner.py	2012-01-25 10:18:29 +0000
@@ -15,11 +15,11 @@
 
 from subprocess import check_call
 
-from django.test.simple import DjangoTestSuiteRunner
+from django_nose import NoseTestSuiteRunner
 from testresources import OptimisingTestSuite
 
 
-class TestRunner(DjangoTestSuiteRunner):
+class TestRunner(NoseTestSuiteRunner):
     """Custom test runner; ensures that the test database cluster is up."""
 
     def build_suite(self, test_labels, extra_tests=None, **kwargs):