Test django view with cookies

| Comments

To test some view which use cookies:

from Cookie import SimpleCookie
from django import test

class SomeTest(test.TestCase):

    def test_some_view(self):
        self.client.cookies = SimpleCookie({'test_cookie': 'test_value'})
        response = self.client.get('/some-url/')

        self.assertEqual(response.client.cookies['test_cookie'].value, 'test_value')