from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from patchwork.models import EmailOptout, EmailConfirmation, Person
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from patchwork.models import EmailOptout, EmailConfirmation, Person
response = self.client.post(self.url, {'email': 'foo'})
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'patchwork/mail-form.html')
response = self.client.post(self.url, {'email': 'foo'})
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'patchwork/mail-form.html')
- self.assertFormError(response, 'form', 'email',
- 'Enter a valid e-mail address.')
+ self.assertFormError(response, 'form', 'email', error_strings['email'])
def testOptoutRequestInvalidPOSTNonEmail(self):
response = self.client.post(self.url, {'email': 'foo'})
self.assertEquals(response.status_code, 200)
def testOptoutRequestInvalidPOSTNonEmail(self):
response = self.client.post(self.url, {'email': 'foo'})
self.assertEquals(response.status_code, 200)
- self.assertFormError(response, 'form', 'email',
- 'Enter a valid e-mail address.')
+ self.assertFormError(response, 'form', 'email', error_strings['email'])
self.assertTrue(response.context['error'])
self.assertTrue('email_sent' not in response.context)
self.assertEquals(len(mail.outbox), 0)
self.assertTrue(response.context['error'])
self.assertTrue('email_sent' not in response.context)
self.assertEquals(len(mail.outbox), 0)
def testOptoutRequestInvalidPOSTNonEmail(self):
response = self.client.post(self.url, {'email': 'foo'})
self.assertEquals(response.status_code, 200)
def testOptoutRequestInvalidPOSTNonEmail(self):
response = self.client.post(self.url, {'email': 'foo'})
self.assertEquals(response.status_code, 200)
- self.assertFormError(response, 'form', 'email',
- 'Enter a valid e-mail address.')
+ self.assertFormError(response, 'form', 'email', error_strings['email'])
self.assertTrue(response.context['error'])
self.assertTrue('email_sent' not in response.context)
self.assertEquals(len(mail.outbox), 0)
self.assertTrue(response.context['error'])
self.assertTrue('email_sent' not in response.context)
self.assertEquals(len(mail.outbox), 0)
response = self.client.get(self.url)
self.assertEquals(response.status_code, 200)
self.assertTrue(form_re.search(response.content) is not None)
response = self.client.get(self.url)
self.assertEquals(response.status_code, 200)
self.assertTrue(form_re.search(response.content) is not None)