Ticket #16196: 16196.diff
File 16196.diff, 11.3 KB (added by , 13 years ago) |
---|
-
tests/regressiontests/cache/tests.py
131 131 u'ascii': u'ascii_value', 132 132 u'unicode_ascii': u'Iñtërnâtiônàlizætiøn1', 133 133 u'Iñtërnâtiônàlizætiøn': u'Iñtërnâtiônàlizætiøn2', 134 u'ascii ': {u'x' : 1 }134 u'ascii2': {u'x' : 1 } 135 135 } 136 136 for (key, value) in stuff.items(): 137 137 self.cache.set(key, value) … … 317 317 u'ascii': u'ascii_value', 318 318 u'unicode_ascii': u'Iñtërnâtiônàlizætiøn1', 319 319 u'Iñtërnâtiônàlizætiøn': u'Iñtërnâtiônàlizætiøn2', 320 u'ascii ': {u'x' : 1 }320 u'ascii2': {u'x' : 1 } 321 321 } 322 322 # Test `set` 323 323 for (key, value) in stuff.items(): -
tests/regressiontests/multiple_database/tests.py
1612 1612 return model._meta.object_name == 'Pet' 1613 1613 else: 1614 1614 return model._meta.object_name != 'Pet' 1615 return None1616 1615 1617 1616 class FixtureTestCase(TestCase): 1618 1617 multi_db = True -
tests/regressiontests/delete_regress/tests.py
54 54 # Delete something using connection 2. 55 55 cursor2 = self.conn2.cursor() 56 56 cursor2.execute('DELETE from delete_regress_book WHERE id=1') 57 self.conn2._commit() ;57 self.conn2._commit() 58 58 59 59 # Now perform a queryset delete that covers the object 60 60 # deleted in connection 2. This causes an infinite loop -
tests/regressiontests/syndication/tests.py
25 25 elem.getElementsByTagName(k)[0].firstChild.wholeText, v) 26 26 27 27 def assertCategories(self, elem, expected): 28 self.assertEqual(set(i.firstChild.wholeText for i in elem.childNodes if i.nodeName == 'category'), set(expected)) ;28 self.assertEqual(set(i.firstChild.wholeText for i in elem.childNodes if i.nodeName == 'category'), set(expected)) 29 29 30 30 ###################################### 31 31 # Feed view … … 73 73 'ttl': '600', 74 74 'copyright': 'Copyright (c) 2007, Sally Smith', 75 75 }) 76 self.assertCategories(chan, ['python', 'django']) ;76 self.assertCategories(chan, ['python', 'django']) 77 77 78 78 # Ensure the content of the channel is correct 79 79 self.assertChildNodeContent(chan, { … … 102 102 'pubDate': pub_date, 103 103 'author': 'test@example.com (Sally Smith)', 104 104 }) 105 self.assertCategories(items[0], ['python', 'testing']) ;105 self.assertCategories(items[0], ['python', 'testing']) 106 106 107 107 for item in items: 108 108 self.assertChildNodes(item, ['title', 'link', 'description', 'guid', 'category', 'pubDate', 'author']) -
tests/regressiontests/model_regress/tests.py
48 48 article_text = "ABCDE" * 1000 49 49 ) 50 50 a = Article.objects.get(pk=a.pk) 51 self.assertEqual 52 (len(a.article_text), 5000) 51 self.assertEqual(len(a.article_text), 5000) 53 52 54 53 def test_date_lookup(self): 55 54 # Regression test for #659 -
tests/regressiontests/forms/localflavor/id.py
133 133 invalid = { 134 134 '0123456789': error_invalid, 135 135 '+62-021-3456789': error_invalid, 136 '+62-021-3456789': error_invalid,137 136 '+62-0812-3456789': error_invalid, 138 137 '0812345678901': error_invalid, 139 138 'foo': error_invalid, -
tests/regressiontests/forms/localflavor/ar.py
92 92 '20-10123456': error_format, 93 93 '20-10123456-': error_format, 94 94 '20-10123456-5': error_invalid, 95 '2-10123456-9': error_format,96 95 '27-10345678-1': error_invalid, 97 96 u'27-10345678-1': error_invalid, 98 97 } -
tests/regressiontests/forms/localflavor/pt.py
21 21 valid = { 22 22 '917845189': '917845189', 23 23 '91 784 5189': '917845189', 24 '91 784 5189': '917845189',25 24 '+351 91 111': '+35191111', 26 25 '00351873': '00351873', 27 26 } -
tests/regressiontests/generic_views/views.py
42 42 """A ListView that doesn't use a model.""" 43 43 queryset = [ 44 44 {'first': 'John', 'last': 'Lennon'}, 45 {' last': 'Yoko', 'last': 'Ono'}45 {'first': 'Yoko', 'last': 'Ono'} 46 46 ] 47 47 template_name = 'generic_views/list.html' 48 48 … … 65 65 allow_empty_first_page=allow_empty_first_page) 66 66 67 67 class AuthorListCustomPaginator(AuthorList): 68 paginate_by = 5 ;68 paginate_by = 5 69 69 70 70 def get_paginator(self, queryset, page_size, orphans=0, allow_empty_first_page=True): 71 71 return super(AuthorListCustomPaginator, self).get_paginator( -
tests/regressiontests/templates/tests.py
1282 1282 'legacyi18n28': ('{% load i18n %}{% blocktrans with anton as a and berta as b %}{{ a }} + {{ b }}{% endblocktrans %}', {'anton': 'α', 'berta': 'β'}, u'α + β'), 1283 1283 1284 1284 # retrieving language information 1285 'i18n28 ': ('{% load i18n %}{% get_language_info for "de" as l %}{{ l.code }}: {{ l.name }}/{{ l.name_local }} bidi={{ l.bidi }}', {}, 'de: German/Deutsch bidi=False'),1285 'i18n28_2': ('{% load i18n %}{% get_language_info for "de" as l %}{{ l.code }}: {{ l.name }}/{{ l.name_local }} bidi={{ l.bidi }}', {}, 'de: German/Deutsch bidi=False'), 1286 1286 'i18n29': ('{% load i18n %}{% get_language_info for LANGUAGE_CODE as l %}{{ l.code }}: {{ l.name }}/{{ l.name_local }} bidi={{ l.bidi }}', {'LANGUAGE_CODE': 'fi'}, 'fi: Finnish/suomi bidi=False'), 1287 1287 'i18n30': ('{% load i18n %}{% get_language_info_list for langcodes as langs %}{% for l in langs %}{{ l.code }}: {{ l.name }}/{{ l.name_local }} bidi={{ l.bidi }}; {% endfor %}', {'langcodes': ['it', 'no']}, u'it: Italian/italiano bidi=False; no: Norwegian/Norsk bidi=False; '), 1288 1288 'i18n31': ('{% load i18n %}{% get_language_info_list for langcodes as langs %}{% for l in langs %}{{ l.code }}: {{ l.name }}/{{ l.name_local }} bidi={{ l.bidi }}; {% endfor %}', {'langcodes': (('sl', 'Slovenian'), ('fa', 'Persian'))}, u'sl: Slovenian/Sloven\u0161\u010dina bidi=False; fa: Persian/\u0641\u0627\u0631\u0633\u06cc bidi=True; '), … … 1298 1298 'invalidstr02': ('{{ var|default_if_none:"Foo" }}', {}, ('','INVALID')), 1299 1299 'invalidstr03': ('{% for v in var %}({{ v }}){% endfor %}', {}, ''), 1300 1300 'invalidstr04': ('{% if var %}Yes{% else %}No{% endif %}', {}, 'No'), 1301 'invalidstr04 ': ('{% if var|default:"Foo" %}Yes{% else %}No{% endif %}', {}, 'Yes'),1301 'invalidstr04_2': ('{% if var|default:"Foo" %}Yes{% else %}No{% endif %}', {}, 'Yes'), 1302 1302 'invalidstr05': ('{{ var }}', {}, ('', ('INVALID %s', 'var'))), 1303 1303 'invalidstr06': ('{{ var.prop }}', {'var': {}}, ('', ('INVALID %s', 'var.prop'))), 1304 1304 … … 1323 1323 """), 1324 1324 1325 1325 ### REGROUP TAG ########################################################### 1326 'regroup01': ('{% regroup data by bar as grouped %}' + \1327 '{% for group in grouped %}' + \1328 '{{ group.grouper }}:' + \1329 '{% for item in group.list %}' + \1330 '{{ item.foo }}' + \1331 '{% endfor %},' + \1326 'regroup01': ('{% regroup data by bar as grouped %}' + 1327 '{% for group in grouped %}' + 1328 '{{ group.grouper }}:' + 1329 '{% for item in group.list %}' + 1330 '{{ item.foo }}' + 1331 '{% endfor %},' + 1332 1332 '{% endfor %}', 1333 1333 {'data': [ {'foo':'c', 'bar':1}, 1334 1334 {'foo':'d', 'bar':1}, … … 1338 1338 '1:cd,2:ab,3:x,'), 1339 1339 1340 1340 # Test for silent failure when target variable isn't found 1341 'regroup02': ('{% regroup data by bar as grouped %}' + \1342 '{% for group in grouped %}' + \1343 '{{ group.grouper }}:' + \1344 '{% for item in group.list %}' + \1345 '{{ item.foo }}' + \1346 '{% endfor %},' + \1341 'regroup02': ('{% regroup data by bar as grouped %}' + 1342 '{% for group in grouped %}' + 1343 '{{ group.grouper }}:' + 1344 '{% for item in group.list %}' + 1345 '{{ item.foo }}' + 1346 '{% endfor %},' + 1347 1347 '{% endfor %}', 1348 1348 {}, ''), 1349 1349 ### SSI TAG ######################################################## -
tests/regressiontests/introspection/tests.py
45 45 46 46 def test_django_table_names(self): 47 47 cursor = connection.cursor() 48 cursor.execute('CREATE TABLE django_ixn_test_table (id INTEGER);') ;48 cursor.execute('CREATE TABLE django_ixn_test_table (id INTEGER);') 49 49 tl = connection.introspection.django_table_names() 50 50 cursor.execute("DROP TABLE django_ixn_test_table;") 51 51 self.assertTrue('django_ixn_testcase_table' not in tl,