2013-08-21 01:59:23 +08:00
|
|
|
from django.test import TestCase
|
2013-03-19 06:48:47 +08:00
|
|
|
from django.contrib.messages.tests.urls import ContactFormViewWithMsg
|
|
|
|
from django.core.urlresolvers import reverse
|
|
|
|
|
2013-11-03 04:12:09 +08:00
|
|
|
|
2013-03-19 06:48:47 +08:00
|
|
|
class SuccessMessageMixinTests(TestCase):
|
|
|
|
urls = 'django.contrib.messages.tests.urls'
|
|
|
|
|
|
|
|
def test_set_messages_success(self):
|
|
|
|
author = {'name': 'John Doe',
|
|
|
|
'slug': 'success-msg'}
|
|
|
|
add_url = reverse('add_success_msg')
|
|
|
|
req = self.client.post(add_url, author)
|
|
|
|
self.assertIn(ContactFormViewWithMsg.success_message % author,
|
|
|
|
req.cookies['messages'].value)
|