Ticket #6507: tests.py

File tests.py, 551 bytes (added by QingFeng, 15 years ago)

parse_cookie unit test

Line 
1#encoding: utf-8
2"""
3This file demonstrates two different styles of tests (one doctest and one
4unittest). These will both pass when you run "manage.py test".
5
6Replace these with more appropriate tests for your application.
7"""
8
9from django.test import TestCase
10from django import http
11
12class SimpleTest(TestCase):
13 def test_basic_addition(self):
14 cookie_str = 'name=qingfeng;???=456;'#Error Cookie!
15 cookie = http.parse_cookie(cookie_str)
16 self.assertTrue('name' in cookie)
17 self.assertEqual(cookie['name'],'qingfeng')
18
Back to Top