mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	git-svn-id: http://code.djangoproject.com/svn/django/trunk@16975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
		
			
				
	
	
		
			26 lines
		
	
	
		
			876 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			876 B
		
	
	
	
		
			Python
		
	
	
	
	
	
|  # -*- coding: utf-8 -*-
 | |
| from __future__ import absolute_import
 | |
| 
 | |
| import datetime
 | |
| 
 | |
| from django.test import TestCase
 | |
| 
 | |
| from .models import Article, InternationalArticle
 | |
| 
 | |
| 
 | |
| class SimpleTests(TestCase):
 | |
|     def test_basic(self):
 | |
|         a = Article.objects.create(
 | |
|             headline='Area man programs in Python',
 | |
|             pub_date=datetime.datetime(2005, 7, 28)
 | |
|         )
 | |
|         self.assertEqual(str(a), 'Area man programs in Python')
 | |
|         self.assertEqual(repr(a), '<Article: Area man programs in Python>')
 | |
| 
 | |
|     def test_international(self):
 | |
|         a = InternationalArticle.objects.create(
 | |
|             headline=u'Girl wins €12.500 in lottery',
 | |
|             pub_date=datetime.datetime(2005, 7, 28)
 | |
|         )
 | |
|         # The default str() output will be the UTF-8 encoded output of __unicode__().
 | |
|         self.assertEqual(str(a), 'Girl wins \xe2\x82\xac12.500 in lottery') |