"date_joined": "2009-01-01 00:01:01"
}
},
+ {"pk": 7, "model": "auth.user",
+ "fields": {
+ "username": "supertest",
+ "first_name": "",
+ "last_name": "",
+ "is_active": true,
+ "is_superuser": true,
+ "is_staff": true,
+ "last_login": "2009-01-01 00:00:01",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$foo$5e4eefec1144a04becfb7da79244f07c487fc345",
+ "email": "",
+ "date_joined": "2009-01-01 00:01:01"
+ }
+ },
{"pk": 1, "model": "experiments.clusterstation", "fields": {"name": "old"}},
{"pk": 2, "model": "experiments.clusterstation", "fields": {"name": "loaner"}},
{"pk": 3, "model": "experiments.clusterstation", "fields": {"name": "new"}},
class Meta:
ordering = ["-run_date"]
+
+ def get_admin_url(self):
+ # that's the django way... except it didn't work
+ #return urlresolvers.reverse('admin_experiments_FlowCell_change', args=(self.id,))
+ return '/admin/experiments/flowcell/%s/' % (self.id,)
### -----------------------
class DataRun(models.Model):
+import re
try:
import json
except ImportError, e:
self.failUnlessEqual(len(mail.outbox), 4)
for m in mail.outbox:
self.failUnless(len(m.body) > 0)
+
+ def test_email_navigation(self):
+ """
+ Can we navigate between the flowcell and email forms properly?
+ """
+ self.client.login(username='supertest', password='BJOKL5kAj6aFZ6A5')
+ response = self.client.get('/experiments/started/153/')
+ self.failUnlessEqual(response.status_code, 200)
+ self.failUnless(re.search('Flowcell 303TUAAXX', response.content))
+ # require that navigation back to the admin page exists
+ self.failUnless(re.search('<a href="/admin/experiments/flowcell/153/">[^<]+</a>', response.content))
+
})
# build view
- subject = "Flowcell %s" % ( fc.flowcell_id )
+ subject = "Flowcell %s" % ( fc.flowcell_id )
body = email_template.render(context)
if send:
emails.append((user_email, subject, body, sending))
verify_context = Context({
- 'send': send,
- 'warnings': warnings,
'emails': emails,
+ 'flowcell': fc,
'from': sender,
+ 'send': send,
'site_managers': settings.MANAGERS,
+ 'title': fc.flowcell_id,
+ 'warnings': warnings,
})
return HttpResponse(email_verify.render(verify_context))
{% load i18n %}
<!-- Container -->
- <!--
- {% if not is_popup %}
+ {% if not is_popup %}
<div id="header">
<div id="branding">
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} › {{ title }}{% endif %}</div>{% endblock %}
{% endif %}
- -->
- {% if messages %}
+ {% if messages %}
<ul class="djangocss" class="messagelist">{% for message in messages %}<li>{{ message }}</li>{% endfor %}</ul>
{% endif %}
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html> <head>
-<title></title>
-</head>
-<body>
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block breadcrumbs %}
+<div class="breadcrumbs">
+ <a href="/admin">{% trans 'Home' %}</a> ›
+ <a href="/admin/experiments">Experiments</a> ›
+ <a href="/admin/experiments/flowcell">flowcell</a> ›
+ <a href="{{ flowcell.get_admin_url }}">{{ flowcell.flowcell_id }}</a>
+</div>
+{% endblock %}
+
+{% block content %}
+{% if warnings %}
+<hr/>
<p>
{% for user_admin_url, username in warnings %}
Warning: User <a href="{{ user_admin_url}}">{{ username }}</a> has no
email address <br/>
{% endfor %}
+{% endif %}
</p>
{% for to, subject, body, sending in emails %}
<hr/>
<input type="checkbox" id="bcc" name="bcc" checked="on"/><br/>
<input type="hidden" name="send" value="1"/>
<input type="submit" value="Send Email"/>
-</body>
-</html>
+{% endblock %}
\ No newline at end of file