1 | #encoding: utf-8
|
---|
2 | """
|
---|
3 | This file demonstrates two different styles of tests (one doctest and one
|
---|
4 | unittest). These will both pass when you run "manage.py test".
|
---|
5 |
|
---|
6 | Replace these with more appropriate tests for your application.
|
---|
7 | """
|
---|
8 |
|
---|
9 | from django.test import TestCase
|
---|
10 | from django import http
|
---|
11 |
|
---|
12 | class 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 |
|
---|