summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-10-10 16:42:30 -0400
committerTim Graham <timograham@gmail.com>2013-10-10 16:49:20 -0400
commit1dae4ac1778f04805c0ed62c8debb13b281ba02b (patch)
tree5105833792cc07336de819effb1c9dccdbc0c76e /tests
parentca874b2fe6f768bd042b859d7eba622a68e9f9dd (diff)
Whitespace cleanup.
* Removed trailing whitespace. * Added newline to EOF if missing. * Removed blank lines at EOF. * Removed some stray tabs.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_custom_urls/fixtures/actions.json34
-rw-r--r--tests/admin_custom_urls/urls.py1
-rw-r--r--tests/admin_scripts/custom_templates/app_template/api.py2
-rw-r--r--tests/admin_scripts/custom_templates/app_template/models.py2
-rw-r--r--tests/admin_scripts/custom_templates/project_template/additional_dir/additional_file.py2
-rw-r--r--tests/admin_scripts/management/commands/app_command.py1
-rw-r--r--tests/admin_scripts/tests.py2
-rw-r--r--tests/admin_widgets/fixtures/admin-widgets-users.xml2
-rw-r--r--tests/admin_widgets/widgetadmin.py5
-rw-r--r--tests/aggregation/models.py1
-rw-r--r--tests/bash_completion/models.py1
-rw-r--r--tests/cache/liberal_backend.py1
-rw-r--r--tests/cache/tests.py1
-rw-r--r--tests/choices/tests.py1
-rw-r--r--tests/comment_tests/tests/__init__.py1
-rw-r--r--tests/conditional_processing/views.py1
-rw-r--r--tests/context_processors/tests.py1
-rw-r--r--tests/createsuperuser/tests.py1
-rw-r--r--tests/custom_columns/models.py1
-rw-r--r--tests/custom_columns_regress/models.py3
-rw-r--r--tests/custom_managers_regress/tests.py1
-rw-r--r--tests/custom_pk/models.py1
-rw-r--r--tests/decorators/models.py1
-rw-r--r--tests/defaultfilters/tests.py2
-rw-r--r--tests/distinct_on_fields/tests.py1
-rw-r--r--tests/expressions_regress/models.py1
-rw-r--r--tests/extra_regress/models.py1
-rw-r--r--tests/fixtures/fixtures/fixture2.json14
-rw-r--r--tests/fixtures_model_package/fixtures/fixture1.json14
-rw-r--r--tests/fixtures_model_package/fixtures/fixture2.json14
-rw-r--r--tests/fixtures_regress/fixtures/absolute.json4
-rw-r--r--tests/fixtures_regress/fixtures/big-fixture.json22
-rw-r--r--tests/fixtures_regress/fixtures/sequence.json6
-rw-r--r--tests/generic_inline_admin/models.py2
-rw-r--r--tests/generic_views/test_edit.py1
-rw-r--r--tests/http_utils/tests.py2
-rw-r--r--tests/i18n/resolution/models.py2
-rw-r--r--tests/initial_sql_regress/models.py1
-rw-r--r--tests/known_related_objects/models.py1
-rw-r--r--tests/m2m_and_m2o/models.py1
-rw-r--r--tests/m2m_intermediary/models.py1
-rw-r--r--tests/m2m_regress/tests.py1
-rw-r--r--tests/mail/models.py1
-rw-r--r--tests/migrations/test_migrations/0001_initial.py4
-rw-r--r--tests/migrations/test_migrations_2/0001_initial.py4
-rw-r--r--tests/migrations/test_state.py6
-rw-r--r--tests/multiple_database/routers.py1
-rw-r--r--tests/resolve_url/tests.py1
-rw-r--r--tests/tablespaces/tests.py2
-rw-r--r--tests/template_tests/templatetags/broken_tag.py2
-rw-r--r--tests/test_client/fixtures/testdata.json78
-rw-r--r--tests/test_client_regress/fixtures/testdata.json78
-rw-r--r--tests/urlpatterns_reverse/included_named_urls.py1
-rw-r--r--tests/urlpatterns_reverse/included_named_urls2.py1
-rw-r--r--tests/urlpatterns_reverse/included_namespace_urls.py1
-rw-r--r--tests/urlpatterns_reverse/no_urls.py1
-rw-r--r--tests/urlpatterns_reverse/tests.py1
-rw-r--r--tests/utils_tests/files/strip_tags1.html58
-rw-r--r--tests/utils_tests/files/strip_tags2.txt26
-rw-r--r--tests/utils_tests/test_module/bad_module.py2
-rw-r--r--tests/utils_tests/test_module/good_module.py2
-rw-r--r--tests/validation/__init__.py1
-rw-r--r--tests/validation/test_custom_messages.py1
-rw-r--r--tests/validation/test_unique.py1
-rw-r--r--tests/version/tests.py1
-rw-r--r--tests/view_tests/__init__.py1
-rw-r--r--tests/view_tests/templatetags/debugtags.py1
-rw-r--r--tests/view_tests/tests/test_specials.py1
68 files changed, 197 insertions, 238 deletions
diff --git a/tests/admin_custom_urls/fixtures/actions.json b/tests/admin_custom_urls/fixtures/actions.json
index 7c6341d71d..7eda3a3ab0 100644
--- a/tests/admin_custom_urls/fixtures/actions.json
+++ b/tests/admin_custom_urls/fixtures/actions.json
@@ -1,42 +1,42 @@
[
{
- "pk": "delete",
- "model": "admin_custom_urls.action",
+ "pk": "delete",
+ "model": "admin_custom_urls.action",
"fields": {
"description": "Remove things."
}
- },
+ },
{
- "pk": "rename",
- "model": "admin_custom_urls.action",
+ "pk": "rename",
+ "model": "admin_custom_urls.action",
"fields": {
"description": "Gives things other names."
}
- },
+ },
{
- "pk": "add",
- "model": "admin_custom_urls.action",
+ "pk": "add",
+ "model": "admin_custom_urls.action",
"fields": {
"description": "Add things."
}
- },
+ },
{
- "pk": "path/to/file/",
- "model": "admin_custom_urls.action",
+ "pk": "path/to/file/",
+ "model": "admin_custom_urls.action",
"fields": {
"description": "An action with '/' in its name."
}
- },
+ },
{
- "pk": "path/to/html/document.html",
- "model": "admin_custom_urls.action",
+ "pk": "path/to/html/document.html",
+ "model": "admin_custom_urls.action",
"fields": {
"description": "An action with a name similar to a HTML doc path."
}
- },
+ },
{
- "pk": "javascript:alert('Hello world');\">Click here</a>",
- "model": "admin_custom_urls.action",
+ "pk": "javascript:alert('Hello world');\">Click here</a>",
+ "model": "admin_custom_urls.action",
"fields": {
"description": "An action with a name suspected of being a XSS attempt"
}
diff --git a/tests/admin_custom_urls/urls.py b/tests/admin_custom_urls/urls.py
index 478390737d..5fe9ca89fb 100644
--- a/tests/admin_custom_urls/urls.py
+++ b/tests/admin_custom_urls/urls.py
@@ -5,4 +5,3 @@ from django.contrib import admin
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
)
-
diff --git a/tests/admin_scripts/custom_templates/app_template/api.py b/tests/admin_scripts/custom_templates/app_template/api.py
index 439d935f73..ad7ec51b0b 100644
--- a/tests/admin_scripts/custom_templates/app_template/api.py
+++ b/tests/admin_scripts/custom_templates/app_template/api.py
@@ -1 +1 @@
-# your API code \ No newline at end of file
+# your API code
diff --git a/tests/admin_scripts/custom_templates/app_template/models.py b/tests/admin_scripts/custom_templates/app_template/models.py
index 92be216cfc..fcd0b215d8 100644
--- a/tests/admin_scripts/custom_templates/app_template/models.py
+++ b/tests/admin_scripts/custom_templates/app_template/models.py
@@ -1 +1 @@
-# whatever \ No newline at end of file
+# whatever
diff --git a/tests/admin_scripts/custom_templates/project_template/additional_dir/additional_file.py b/tests/admin_scripts/custom_templates/project_template/additional_dir/additional_file.py
index 032f0bcd72..43c1e1436a 100644
--- a/tests/admin_scripts/custom_templates/project_template/additional_dir/additional_file.py
+++ b/tests/admin_scripts/custom_templates/project_template/additional_dir/additional_file.py
@@ -1 +1 @@
-# some file for {{ project_name }} test project \ No newline at end of file
+# some file for {{ project_name }} test project
diff --git a/tests/admin_scripts/management/commands/app_command.py b/tests/admin_scripts/management/commands/app_command.py
index d26df12642..5cbddb6e96 100644
--- a/tests/admin_scripts/management/commands/app_command.py
+++ b/tests/admin_scripts/management/commands/app_command.py
@@ -8,4 +8,3 @@ class Command(AppCommand):
def handle_app(self, app, **options):
print('EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items())))
-
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 9f7c8d7b54..db5f6e263e 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -1633,7 +1633,7 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
for f in ('Procfile', 'additional_file.py', 'requirements.txt'):
self.assertTrue(os.path.exists(os.path.join(base_path, f)))
with open(os.path.join(base_path, f)) as fh:
- self.assertEqual(fh.read(),
+ self.assertEqual(fh.read().strip(),
'# some file for customtestproject test project')
def test_custom_project_template_context_variables(self):
diff --git a/tests/admin_widgets/fixtures/admin-widgets-users.xml b/tests/admin_widgets/fixtures/admin-widgets-users.xml
index b851562a1c..f677215c6d 100644
--- a/tests/admin_widgets/fixtures/admin-widgets-users.xml
+++ b/tests/admin_widgets/fixtures/admin-widgets-users.xml
@@ -28,7 +28,7 @@
<field to="auth.group" name="groups" rel="ManyToManyRel"></field>
<field to="auth.permission" name="user_permissions" rel="ManyToManyRel"></field>
</object>
-
+
<object pk="1" model="admin_widgets.car">
<field to="auth.user" name="owner" rel="ManyToOneRel">100</field>
<field type="CharField" name="make">Volkswagon</field>
diff --git a/tests/admin_widgets/widgetadmin.py b/tests/admin_widgets/widgetadmin.py
index 5eea29654b..fa46530037 100644
--- a/tests/admin_widgets/widgetadmin.py
+++ b/tests/admin_widgets/widgetadmin.py
@@ -6,10 +6,12 @@ from . import models
class WidgetAdmin(admin.AdminSite):
pass
+
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
+
class CarTireAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == "car":
@@ -17,6 +19,7 @@ class CarTireAdmin(admin.ModelAdmin):
return db_field.formfield(**kwargs)
return super(CarTireAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
+
class EventAdmin(admin.ModelAdmin):
raw_id_fields = ['main_band', 'supporting_bands']
@@ -44,4 +47,4 @@ site.register(models.Advisor)
site.register(models.School, SchoolAdmin)
-site.register(models.Profile) \ No newline at end of file
+site.register(models.Profile)
diff --git a/tests/aggregation/models.py b/tests/aggregation/models.py
index b4f797ee03..9710afaf11 100644
--- a/tests/aggregation/models.py
+++ b/tests/aggregation/models.py
@@ -44,4 +44,3 @@ class Store(models.Model):
def __str__(self):
return self.name
-
diff --git a/tests/bash_completion/models.py b/tests/bash_completion/models.py
index 8b13789179..e69de29bb2 100644
--- a/tests/bash_completion/models.py
+++ b/tests/bash_completion/models.py
@@ -1 +0,0 @@
-
diff --git a/tests/cache/liberal_backend.py b/tests/cache/liberal_backend.py
index b72013c6a8..3e3ce3beeb 100644
--- a/tests/cache/liberal_backend.py
+++ b/tests/cache/liberal_backend.py
@@ -7,4 +7,3 @@ class LiberalKeyValidationMixin(object):
class CacheClass(LiberalKeyValidationMixin, LocMemCache):
pass
-
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index 462c1b236d..d46c61df67 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -1917,4 +1917,3 @@ class TestMakeTemplateFragmentKey(TestCase):
key = make_template_fragment_key('spam', ['abc:def%'])
self.assertEqual(key,
'template.cache.spam.f27688177baec990cdf3fbd9d9c3f469')
-
diff --git a/tests/choices/tests.py b/tests/choices/tests.py
index 2d612626c2..329c936c7f 100644
--- a/tests/choices/tests.py
+++ b/tests/choices/tests.py
@@ -20,4 +20,3 @@ class ChoicesTests(TestCase):
a.gender = 'U'
self.assertEqual(a.get_gender_display(), 'U')
-
diff --git a/tests/comment_tests/tests/__init__.py b/tests/comment_tests/tests/__init__.py
index df6d60010f..2e247079f8 100644
--- a/tests/comment_tests/tests/__init__.py
+++ b/tests/comment_tests/tests/__init__.py
@@ -82,4 +82,3 @@ class CommentTestCase(TestCase):
d = self.getData()
d.update(f.initial)
return d
-
diff --git a/tests/conditional_processing/views.py b/tests/conditional_processing/views.py
index d4dc4b8cf6..2960e0533d 100644
--- a/tests/conditional_processing/views.py
+++ b/tests/conditional_processing/views.py
@@ -23,4 +23,3 @@ etag_view1 = condition(etag_func=lambda r: ETAG)(etag_view1)
def etag_view2(request):
return HttpResponse(FULL_RESPONSE)
etag_view2 = etag(lambda r: ETAG)(etag_view2)
-
diff --git a/tests/context_processors/tests.py b/tests/context_processors/tests.py
index c57c592de6..cfac38bfdc 100644
--- a/tests/context_processors/tests.py
+++ b/tests/context_processors/tests.py
@@ -34,4 +34,3 @@ class RequestContextProcessorTests(TestCase):
self.assertContains(response, url)
response = self.client.post(url, {'path': '/blah/'})
self.assertContains(response, url)
-
diff --git a/tests/createsuperuser/tests.py b/tests/createsuperuser/tests.py
index 7303b1f2e7..f64e4d9915 100644
--- a/tests/createsuperuser/tests.py
+++ b/tests/createsuperuser/tests.py
@@ -53,4 +53,3 @@ class MultiDBCreatesuperuserTestCase(TestCase):
self.assertEqual(u.email, 'joe@somewhere.org')
new_io.close()
-
diff --git a/tests/custom_columns/models.py b/tests/custom_columns/models.py
index 16f0563d6b..16a7838a9f 100644
--- a/tests/custom_columns/models.py
+++ b/tests/custom_columns/models.py
@@ -43,4 +43,3 @@ class Article(models.Model):
class Meta:
ordering = ('headline',)
-
diff --git a/tests/custom_columns_regress/models.py b/tests/custom_columns_regress/models.py
index 169b2246c3..96fe71cef8 100644
--- a/tests/custom_columns_regress/models.py
+++ b/tests/custom_columns_regress/models.py
@@ -36,6 +36,3 @@ class Author(models.Model):
class Meta:
db_table = 'my author table'
ordering = ('last_name','first_name')
-
-
-
diff --git a/tests/custom_managers_regress/tests.py b/tests/custom_managers_regress/tests.py
index 8462e526c9..1737c52926 100644
--- a/tests/custom_managers_regress/tests.py
+++ b/tests/custom_managers_regress/tests.py
@@ -47,4 +47,3 @@ class CustomManagersRegressTestCase(TestCase):
obj = RelatedModel.objects.get(name="xyzzy")
obj.delete()
self.assertEqual(len(OneToOneRestrictedModel.plain_manager.all()), 0)
-
diff --git a/tests/custom_pk/models.py b/tests/custom_pk/models.py
index 8d5065aed8..9833b88706 100644
--- a/tests/custom_pk/models.py
+++ b/tests/custom_pk/models.py
@@ -45,4 +45,3 @@ class Bar(models.Model):
class Foo(models.Model):
bar = models.ForeignKey(Bar)
-
diff --git a/tests/decorators/models.py b/tests/decorators/models.py
index e5a795067b..22e41b9828 100644
--- a/tests/decorators/models.py
+++ b/tests/decorators/models.py
@@ -1,2 +1 @@
# A models.py so that tests run.
-
diff --git a/tests/defaultfilters/tests.py b/tests/defaultfilters/tests.py
index dcd6bb7364..adae44dad3 100644
--- a/tests/defaultfilters/tests.py
+++ b/tests/defaultfilters/tests.py
@@ -341,7 +341,7 @@ class DefaultFiltersTests(TestCase):
self.assertEqual(urlize('before \'hi@example.com afterwards'),
'before \'<a href="mailto:hi@example.com">hi@example.com</a> afterwards')
- # Check urlize copes with commas following URLs in quotes - see #20364
+ # Check urlize copes with commas following URLs in quotes - see #20364
self.assertEqual(urlize('Email us at "hi@example.com", or phone us at +xx.yy'),
'Email us at "<a href="mailto:hi@example.com">hi@example.com</a>", or phone us at +xx.yy')
diff --git a/tests/distinct_on_fields/tests.py b/tests/distinct_on_fields/tests.py
index ec6c2d0463..392178d894 100644
--- a/tests/distinct_on_fields/tests.py
+++ b/tests/distinct_on_fields/tests.py
@@ -114,4 +114,3 @@ class DistinctOnTests(TestCase):
# distinct + aggregate not allowed
with self.assertRaises(NotImplementedError):
Celebrity.objects.distinct('id').aggregate(Max('id'))
-
diff --git a/tests/expressions_regress/models.py b/tests/expressions_regress/models.py
index 711329031d..4679dcd567 100644
--- a/tests/expressions_regress/models.py
+++ b/tests/expressions_regress/models.py
@@ -26,4 +26,3 @@ class Experiment(models.Model):
def duration(self):
return self.end - self.start
-
diff --git a/tests/extra_regress/models.py b/tests/extra_regress/models.py
index 11996438b4..5b4250ca8d 100644
--- a/tests/extra_regress/models.py
+++ b/tests/extra_regress/models.py
@@ -42,4 +42,3 @@ class TestObject(models.Model):
def __str__(self):
return 'TestObject: %s,%s,%s' % (self.first,self.second,self.third)
-
diff --git a/tests/fixtures/fixtures/fixture2.json b/tests/fixtures/fixtures/fixture2.json
index 01b40d7535..a697448327 100644
--- a/tests/fixtures/fixtures/fixture2.json
+++ b/tests/fixtures/fixtures/fixture2.json
@@ -1,17 +1,17 @@
[
{
- "pk": "3",
- "model": "fixtures.article",
+ "pk": "3",
+ "model": "fixtures.article",
"fields": {
- "headline": "Copyright is fine the way it is",
+ "headline": "Copyright is fine the way it is",
"pub_date": "2006-06-16 14:00:00"
}
- },
+ },
{
- "pk": "4",
- "model": "fixtures.article",
+ "pk": "4",
+ "model": "fixtures.article",
"fields": {
- "headline": "Django conquers world!",
+ "headline": "Django conquers world!",
"pub_date": "2006-06-16 15:00:00"
}
}
diff --git a/tests/fixtures_model_package/fixtures/fixture1.json b/tests/fixtures_model_package/fixtures/fixture1.json
index 7684d84609..60ad807aac 100644
--- a/tests/fixtures_model_package/fixtures/fixture1.json
+++ b/tests/fixtures_model_package/fixtures/fixture1.json
@@ -1,17 +1,17 @@
[
{
- "pk": "2",
- "model": "fixtures_model_package.article",
+ "pk": "2",
+ "model": "fixtures_model_package.article",
"fields": {
- "headline": "Poker has no place on ESPN",
+ "headline": "Poker has no place on ESPN",
"pub_date": "2006-06-16 12:00:00"
}
- },
+ },
{
- "pk": "3",
- "model": "fixtures_model_package.article",
+ "pk": "3",
+ "model": "fixtures_model_package.article",
"fields": {
- "headline": "Time to reform copyright",
+ "headline": "Time to reform copyright",
"pub_date": "2006-06-16 13:00:00"
}
}
diff --git a/tests/fixtures_model_package/fixtures/fixture2.json b/tests/fixtures_model_package/fixtures/fixture2.json
index 4997627385..a09bc34d62 100644
--- a/tests/fixtures_model_package/fixtures/fixture2.json
+++ b/tests/fixtures_model_package/fixtures/fixture2.json
@@ -1,17 +1,17 @@
[
{
- "pk": "3",
- "model": "fixtures_model_package.article",
+ "pk": "3",
+ "model": "fixtures_model_package.article",
"fields": {
- "headline": "Copyright is fine the way it is",
+ "headline": "Copyright is fine the way it is",
"pub_date": "2006-06-16 14:00:00"
}
- },
+ },
{
- "pk": "4",
- "model": "fixtures_model_package.article",
+ "pk": "4",
+ "model": "fixtures_model_package.article",
"fields": {
- "headline": "Django conquers world!",
+ "headline": "Django conquers world!",
"pub_date": "2006-06-16 15:00:00"
}
}
diff --git a/tests/fixtures_regress/fixtures/absolute.json b/tests/fixtures_regress/fixtures/absolute.json
index 37ed3f6886..bdf889d333 100644
--- a/tests/fixtures_regress/fixtures/absolute.json
+++ b/tests/fixtures_regress/fixtures/absolute.json
@@ -1,7 +1,7 @@
[
{
- "pk": "1",
- "model": "fixtures_regress.absolute",
+ "pk": "1",
+ "model": "fixtures_regress.absolute",
"fields": {
"name": "Load Absolute Path Test"
}
diff --git a/tests/fixtures_regress/fixtures/big-fixture.json b/tests/fixtures_regress/fixtures/big-fixture.json
index e655fbbf3f..41bd33c6b5 100644
--- a/tests/fixtures_regress/fixtures/big-fixture.json
+++ b/tests/fixtures_regress/fixtures/big-fixture.json
@@ -4,16 +4,16 @@
"model": "fixtures_regress.channel",
"fields": {
"name": "Business"
- }
+ }
},
-
+
{
"pk": 1,
"model": "fixtures_regress.article",
"fields": {
"title": "Article Title 1",
"channels": [6]
- }
+ }
},
{
"pk": 2,
@@ -21,7 +21,7 @@
"fields": {
"title": "Article Title 2",
"channels": [6]
- }
+ }
},
{
"pk": 3,
@@ -29,7 +29,7 @@
"fields": {
"title": "Article Title 3",
"channels": [6]
- }
+ }
},
{
"pk": 4,
@@ -37,7 +37,7 @@
"fields": {
"title": "Article Title 4",
"channels": [6]
- }
+ }
},
{
@@ -46,7 +46,7 @@
"fields": {
"title": "Article Title 5",
"channels": [6]
- }
+ }
},
{
"pk": 6,
@@ -54,7 +54,7 @@
"fields": {
"title": "Article Title 6",
"channels": [6]
- }
+ }
},
{
"pk": 7,
@@ -62,7 +62,7 @@
"fields": {
"title": "Article Title 7",
"channels": [6]
- }
+ }
},
{
"pk": 8,
@@ -70,7 +70,7 @@
"fields": {
"title": "Article Title 8",
"channels": [6]
- }
+ }
},
{
"pk": 9,
@@ -78,6 +78,6 @@
"fields": {
"title": "Yet Another Article",
"channels": [6]
- }
+ }
}
] \ No newline at end of file
diff --git a/tests/fixtures_regress/fixtures/sequence.json b/tests/fixtures_regress/fixtures/sequence.json
index 60bfcdd547..c45ea9420c 100644
--- a/tests/fixtures_regress/fixtures/sequence.json
+++ b/tests/fixtures_regress/fixtures/sequence.json
@@ -1,9 +1,9 @@
[
{
- "pk": "1",
- "model": "fixtures_regress.animal",
+ "pk": "1",
+ "model": "fixtures_regress.animal",
"fields": {
- "name": "Lion",
+ "name": "Lion",
"latin_name": "Panthera leo",
"count": 3,
"weight": 1.2
diff --git a/tests/generic_inline_admin/models.py b/tests/generic_inline_admin/models.py
index dedc351075..cc7de62454 100644
--- a/tests/generic_inline_admin/models.py
+++ b/tests/generic_inline_admin/models.py
@@ -72,5 +72,3 @@ class Contact(models.Model):
#
class EpisodePermanent(Episode):
pass
-
-
diff --git a/tests/generic_views/test_edit.py b/tests/generic_views/test_edit.py
index 9b1ba0f865..d38f4e0f45 100644
--- a/tests/generic_views/test_edit.py
+++ b/tests/generic_views/test_edit.py
@@ -375,4 +375,3 @@ class DeleteViewTests(TestCase):
self.fail('Should raise exception -- No redirect URL provided, and no get_absolute_url provided')
except ImproperlyConfigured:
pass
-
diff --git a/tests/http_utils/tests.py b/tests/http_utils/tests.py
index 9f99c94da7..6e26134c68 100644
--- a/tests/http_utils/tests.py
+++ b/tests/http_utils/tests.py
@@ -47,7 +47,7 @@ class HttpUtilTests(TestCase):
conditional_content_removal(req, res)
self.assertEqual(b''.join(res), b'')
- # Issue #20472
+ # Issue #20472
abc = gzip_compress(b'abc')
res = HttpResponse(abc, status=304)
res['Content-Encoding'] = 'gzip'
diff --git a/tests/i18n/resolution/models.py b/tests/i18n/resolution/models.py
index 4287ca8617..792d600548 100644
--- a/tests/i18n/resolution/models.py
+++ b/tests/i18n/resolution/models.py
@@ -1 +1 @@
-# \ No newline at end of file
+#
diff --git a/tests/initial_sql_regress/models.py b/tests/initial_sql_regress/models.py
index 76de6d3bcb..f23ceefce3 100644
--- a/tests/initial_sql_regress/models.py
+++ b/tests/initial_sql_regress/models.py
@@ -7,4 +7,3 @@ from django.db import models
class Simple(models.Model):
name = models.CharField(max_length = 50)
-
diff --git a/tests/known_related_objects/models.py b/tests/known_related_objects/models.py
index e256cc38f2..cfee4650d9 100644
--- a/tests/known_related_objects/models.py
+++ b/tests/known_related_objects/models.py
@@ -20,4 +20,3 @@ class Pool(models.Model):
class PoolStyle(models.Model):
name = models.CharField(max_length=30)
pool = models.OneToOneField(Pool)
-
diff --git a/tests/m2m_and_m2o/models.py b/tests/m2m_and_m2o/models.py
index 99c7b01017..c303743f04 100644
--- a/tests/m2m_and_m2o/models.py
+++ b/tests/m2m_and_m2o/models.py
@@ -27,4 +27,3 @@ class Issue(models.Model):
class UnicodeReferenceModel(models.Model):
others = models.ManyToManyField("UnicodeReferenceModel")
-
diff --git a/tests/m2m_intermediary/models.py b/tests/m2m_intermediary/models.py
index e9ae422afb..770681f91c 100644
--- a/tests/m2m_intermediary/models.py
+++ b/tests/m2m_intermediary/models.py
@@ -39,4 +39,3 @@ class Writer(models.Model):
def __str__(self):
return '%s (%s)' % (self.reporter, self.position)
-
diff --git a/tests/m2m_regress/tests.py b/tests/m2m_regress/tests.py
index 610f01694a..eaba53a5b4 100644
--- a/tests/m2m_regress/tests.py
+++ b/tests/m2m_regress/tests.py
@@ -108,4 +108,3 @@ class M2MRegressionTests(TestCase):
worksheet.lines = hi
self.assertEqual(1, worksheet.lines.count())
self.assertEqual(1, hi.count())
-
diff --git a/tests/mail/models.py b/tests/mail/models.py
deleted file mode 100644
index 7ff128fa69..0000000000
--- a/tests/mail/models.py
+++ /dev/null
@@ -1 +0,0 @@
-# This file intentionally left blank \ No newline at end of file
diff --git a/tests/migrations/test_migrations/0001_initial.py b/tests/migrations/test_migrations/0001_initial.py
index f20bac8aec..344bebdfe3 100644
--- a/tests/migrations/test_migrations/0001_initial.py
+++ b/tests/migrations/test_migrations/0001_initial.py
@@ -2,7 +2,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
-
+
operations = [
migrations.CreateModel(
@@ -23,5 +23,5 @@ class Migration(migrations.Migration):
("fluffy", models.BooleanField(default=True)),
],
)
-
+
]
diff --git a/tests/migrations/test_migrations_2/0001_initial.py b/tests/migrations/test_migrations_2/0001_initial.py
index 94c4bc0746..6172f011e8 100644
--- a/tests/migrations/test_migrations_2/0001_initial.py
+++ b/tests/migrations/test_migrations_2/0001_initial.py
@@ -4,7 +4,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("migrations", "0002_second")]
-
+
operations = [
migrations.CreateModel(
@@ -17,5 +17,5 @@ class Migration(migrations.Migration):
("silly_field", models.BooleanField(default=False)),
],
),
-
+
]
diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py
index 210897dc66..7c6e7a26b5 100644
--- a/tests/migrations/test_state.py
+++ b/tests/migrations/test_state.py
@@ -45,7 +45,7 @@ class StateTests(TestCase):
author_state = project_state.models['migrations', 'author']
author_proxy_state = project_state.models['migrations', 'authorproxy']
book_state = project_state.models['migrations', 'book']
-
+
self.assertEqual(author_state.app_label, "migrations")
self.assertEqual(author_state.name, "Author")
self.assertEqual([x for x, y in author_state.fields], ["id", "name", "bio", "age"])
@@ -54,7 +54,7 @@ class StateTests(TestCase):
self.assertEqual(author_state.fields[3][1].null, True)
self.assertEqual(author_state.options, {"unique_together": set(("name", "bio"))})
self.assertEqual(author_state.bases, (models.Model, ))
-
+
self.assertEqual(book_state.app_label, "migrations")
self.assertEqual(book_state.name, "Book")
self.assertEqual([x for x, y in book_state.fields], ["id", "title", "author"])
@@ -62,7 +62,7 @@ class StateTests(TestCase):
self.assertEqual(book_state.fields[2][1].null, False)
self.assertEqual(book_state.options, {"verbose_name": "tome", "db_table": "test_tome"})
self.assertEqual(book_state.bases, (models.Model, ))
-
+
self.assertEqual(author_proxy_state.app_label, "migrations")
self.assertEqual(author_proxy_state.name, "AuthorProxy")
self.assertEqual(author_proxy_state.fields, [])
diff --git a/tests/multiple_database/routers.py b/tests/multiple_database/routers.py
index 5d15b5d6b0..8a84e0b3d2 100644
--- a/tests/multiple_database/routers.py
+++ b/tests/multiple_database/routers.py
@@ -58,4 +58,3 @@ class WriteRouter(object):
# A router that only expresses an opinion on writes
def db_for_write(self, model, **hints):
return 'writer'
-
diff --git a/tests/resolve_url/tests.py b/tests/resolve_url/tests.py
index 70f9e51781..92010f87ed 100644
--- a/tests/resolve_url/tests.py
+++ b/tests/resolve_url/tests.py
@@ -66,4 +66,3 @@ class ResolveUrlTests(TestCase):
"""
with self.assertRaises(NoReverseMatch):
resolve_url(lambda: 'asdf')
-
diff --git a/tests/tablespaces/tests.py b/tests/tablespaces/tests.py
index 088938ca1d..401195b5c3 100644
--- a/tests/tablespaces/tests.py
+++ b/tests/tablespaces/tests.py
@@ -6,7 +6,7 @@ from django.conf import settings
from django.db import connection
from django.db import models
from django.db.models.loading import cache
-from django.core.management.color import no_style
+from django.core.management.color import no_style
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from .models import Article, ArticleRef, Authors, Reviewers, Scientist, ScientistRef
diff --git a/tests/template_tests/templatetags/broken_tag.py b/tests/template_tests/templatetags/broken_tag.py
index d69ddaeb2c..c70e183f0e 100644
--- a/tests/template_tests/templatetags/broken_tag.py
+++ b/tests/template_tests/templatetags/broken_tag.py
@@ -1 +1 @@
-from django import Xtemplate \ No newline at end of file
+from django import Xtemplate
diff --git a/tests/test_client/fixtures/testdata.json b/tests/test_client/fixtures/testdata.json
index 0dcf625939..b844809a18 100644
--- a/tests/test_client/fixtures/testdata.json
+++ b/tests/test_client/fixtures/testdata.json
@@ -1,55 +1,55 @@
[
{
- "pk": "1",
- "model": "auth.user",
+ "pk": "1",
+ "model": "auth.user",
"fields": {
- "username": "testclient",
- "first_name": "Test",
- "last_name": "Client",
- "is_active": true,
- "is_superuser": false,
- "is_staff": false,
- "last_login": "2006-12-17 07:03:31",
- "groups": [],
- "user_permissions": [],
- "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
- "email": "testclient@example.com",
+ "username": "testclient",
+ "first_name": "Test",
+ "last_name": "Client",
+ "is_active": true,
+ "is_superuser": false,
+ "is_staff": false,
+ "last_login": "2006-12-17 07:03:31",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
+ "email": "testclient@example.com",
"date_joined": "2006-12-17 07:03:31"
}
},
{
- "pk": "2",
- "model": "auth.user",
+ "pk": "2",
+ "model": "auth.user",
"fields": {
- "username": "inactive",
- "first_name": "Inactive",
- "last_name": "User",
- "is_active": false,
- "is_superuser": false,
- "is_staff": false,
- "last_login": "2006-12-17 07:03:31",
- "groups": [],
- "user_permissions": [],
- "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
- "email": "testclient@example.com",
+ "username": "inactive",
+ "first_name": "Inactive",
+ "last_name": "User",
+ "is_active": false,
+ "is_superuser": false,
+ "is_staff": false,
+ "last_login": "2006-12-17 07:03:31",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
+ "email": "testclient@example.com",
"date_joined": "2006-12-17 07:03:31"
}
},
{
- "pk": "3",
- "model": "auth.user",
+ "pk": "3",
+ "model": "auth.user",
"fields": {
- "username": "staff",
- "first_name": "Staff",
- "last_name": "Member",
- "is_active": true,
- "is_superuser": false,
- "is_staff": true,
- "last_login": "2006-12-17 07:03:31",
- "groups": [],
- "user_permissions": [],
- "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
- "email": "testclient@example.com",
+ "username": "staff",
+ "first_name": "Staff",
+ "last_name": "Member",
+ "is_active": true,
+ "is_superuser": false,
+ "is_staff": true,
+ "last_login": "2006-12-17 07:03:31",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
+ "email": "testclient@example.com",
"date_joined": "2006-12-17 07:03:31"
}
}
diff --git a/tests/test_client_regress/fixtures/testdata.json b/tests/test_client_regress/fixtures/testdata.json
index 0dcf625939..b844809a18 100644
--- a/tests/test_client_regress/fixtures/testdata.json
+++ b/tests/test_client_regress/fixtures/testdata.json
@@ -1,55 +1,55 @@
[
{
- "pk": "1",
- "model": "auth.user",
+ "pk": "1",
+ "model": "auth.user",
"fields": {
- "username": "testclient",
- "first_name": "Test",
- "last_name": "Client",
- "is_active": true,
- "is_superuser": false,
- "is_staff": false,
- "last_login": "2006-12-17 07:03:31",
- "groups": [],
- "user_permissions": [],
- "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
- "email": "testclient@example.com",
+ "username": "testclient",
+ "first_name": "Test",
+ "last_name": "Client",
+ "is_active": true,
+ "is_superuser": false,
+ "is_staff": false,
+ "last_login": "2006-12-17 07:03:31",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
+ "email": "testclient@example.com",
"date_joined": "2006-12-17 07:03:31"
}
},
{
- "pk": "2",
- "model": "auth.user",
+ "pk": "2",
+ "model": "auth.user",
"fields": {
- "username": "inactive",
- "first_name": "Inactive",
- "last_name": "User",
- "is_active": false,
- "is_superuser": false,
- "is_staff": false,
- "last_login": "2006-12-17 07:03:31",
- "groups": [],
- "user_permissions": [],
- "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
- "email": "testclient@example.com",
+ "username": "inactive",
+ "first_name": "Inactive",
+ "last_name": "User",
+ "is_active": false,
+ "is_superuser": false,
+ "is_staff": false,
+ "last_login": "2006-12-17 07:03:31",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
+ "email": "testclient@example.com",
"date_joined": "2006-12-17 07:03:31"
}
},
{
- "pk": "3",
- "model": "auth.user",
+ "pk": "3",
+ "model": "auth.user",
"fields": {
- "username": "staff",
- "first_name": "Staff",
- "last_name": "Member",
- "is_active": true,
- "is_superuser": false,
- "is_staff": true,
- "last_login": "2006-12-17 07:03:31",
- "groups": [],
- "user_permissions": [],
- "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
- "email": "testclient@example.com",
+ "username": "staff",
+ "first_name": "Staff",
+ "last_name": "Member",
+ "is_active": true,
+ "is_superuser": false,
+ "is_staff": true,
+ "last_login": "2006-12-17 07:03:31",
+ "groups": [],
+ "user_permissions": [],
+ "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161",
+ "email": "testclient@example.com",
"date_joined": "2006-12-17 07:03:31"
}
}
diff --git a/tests/urlpatterns_reverse/included_named_urls.py b/tests/urlpatterns_reverse/included_named_urls.py
index 366fe9b57a..14d2525114 100644
--- a/tests/urlpatterns_reverse/included_named_urls.py
+++ b/tests/urlpatterns_reverse/included_named_urls.py
@@ -9,4 +9,3 @@ urlpatterns = patterns('',
url(r'^(?P<one>\d+)|(?P<two>\d+)/$', empty_view),
(r'^included/', include('urlpatterns_reverse.included_named_urls2')),
)
-
diff --git a/tests/urlpatterns_reverse/included_named_urls2.py b/tests/urlpatterns_reverse/included_named_urls2.py
index b8e4c531fa..897d9e7487 100644
--- a/tests/urlpatterns_reverse/included_named_urls2.py
+++ b/tests/urlpatterns_reverse/included_named_urls2.py
@@ -8,4 +8,3 @@ urlpatterns = patterns('',
url(r'^extra/(?P<extra>\w+)/$', empty_view, name="named-url6"),
url(r'^(?P<one>\d+)|(?P<two>\d+)/$', empty_view),
)
-
diff --git a/tests/urlpatterns_reverse/included_namespace_urls.py b/tests/urlpatterns_reverse/included_namespace_urls.py
index ae098a64dc..aaa1a03687 100644
--- a/tests/urlpatterns_reverse/included_namespace_urls.py
+++ b/tests/urlpatterns_reverse/included_namespace_urls.py
@@ -21,4 +21,3 @@ urlpatterns = patterns('urlpatterns_reverse.views',
(r'^ns-included3/', include('urlpatterns_reverse.included_urls', namespace='inc-ns3')),
(r'^ns-included4/', include('urlpatterns_reverse.namespace_urls', namespace='inc-ns4')),
)
-
diff --git a/tests/urlpatterns_reverse/no_urls.py b/tests/urlpatterns_reverse/no_urls.py
index 5b1959c7dc..1cd34c78f7 100644
--- a/tests/urlpatterns_reverse/no_urls.py
+++ b/tests/urlpatterns_reverse/no_urls.py
@@ -1,2 +1 @@
#from django.conf.urls import patterns, url, include
-
diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py
index 4d77dc946d..9ed1e8f714 100644
--- a/tests/urlpatterns_reverse/tests.py
+++ b/tests/urlpatterns_reverse/tests.py
@@ -656,4 +656,3 @@ class ViewLoadingTests(TestCase):
# swallow it.
self.assertRaises(AttributeError, get_callable,
'urlpatterns_reverse.views_broken.i_am_broken')
-
diff --git a/tests/utils_tests/files/strip_tags1.html b/tests/utils_tests/files/strip_tags1.html
index 8e9ee1d8fd..5e191f31fd 100644
--- a/tests/utils_tests/files/strip_tags1.html
+++ b/tests/utils_tests/files/strip_tags1.html
@@ -13,7 +13,7 @@
<link rel="logo" type="image/svg" href="http://github-media-downloads.s3.amazonaws.com/github-logo.svg" />
<meta name="msapplication-TileImage" content="/windows-tile.png">
<meta name="msapplication-TileColor" content="#ffffff">
-
+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta content="authenticity_token" name="csrf-param" />
@@ -21,12 +21,12 @@
<link href="https://a248.e.akamai.net/assets.github.com/assets/github-f70e4783e00fd4884a9e5e651a43933c9881caa8.css" media="all" rel="stylesheet" type="text/css" />
<link href="https://a248.e.akamai.net/assets.github.com/assets/github2-0d31290d073dea4d8671e2b8c747629aeb074034.css" media="all" rel="stylesheet" type="text/css" />
-
+
<script src="https://a248.e.akamai.net/assets.github.com/assets/frameworks-d76b58e749b52bc47a4c46620bf2c320fabe5248.js" type="text/javascript"></script>
<script src="https://a248.e.akamai.net/assets.github.com/assets/github-67b55380cff8d6766b298e6935a3c1db7d5c6d5d.js" type="text/javascript"></script>
-
+
<meta http-equiv="x-pjax-version" content="1212ad79754350a805cefbcd08a3dadf">
<link data-pjax-transient rel='alternate' type='text/plain+diff' href="&#x2F;django&#x2F;django&#x2F;commit&#x2F;d7504a3d7b8645bdb979bab7ded0e9a9b6dccd0e.diff">
@@ -89,9 +89,9 @@
</ul>
</div>
-
-
+
+
<ul id="user-links">
<li>
<a href="https://github.com/claudep" class="name">
@@ -119,17 +119,17 @@
-
+
</div>
</div>
<div class="site hfeed" itemscope itemtype="http://schema.org/WebPage">
<div class="hentry">
-
+
<div class="pagehead repohead instapaper_ignore readability-menu ">
<div class="container">
<div class="title-actions-bar">
-
+
<ul class="pagehead-actions">
@@ -240,7 +240,7 @@
</h1>
</div>
-
+
<ul class="tabs">
<li><a href="/django/django" class="selected" highlight="repo_source repo_downloads repo_commits repo_tags repo_branches">Code</a></li>
<li><a href="/django/django/network" highlight="repo_network">Network</a></li>
@@ -256,14 +256,14 @@
</li>
</ul>
-
+
<div class="tabnav">
<span class="tabnav-right">
<ul class="tabnav-tabs">
<li><a href="/django/django/tags" class="tabnav-tab" highlight="repo_tags">Tags <span class="counter ">39</span></a></li>
</ul>
-
+
</span>
<div class="tabnav-widget scope">
@@ -648,17 +648,17 @@
</div>
-
-
-
-
+
+
+
+
</div>
</div><!-- /.repohead -->
<div id="js-repo-pjax-container" class="container context-loader-container" data-pjax-container>
-
+
<div class="commit full-commit ">
@@ -675,7 +675,7 @@
<span class="sha-block" data-pjax>
1 parent
-
+
<a href="/django/django/commit/afa3e1633431137f4e76c7efc359b579f4d9c08e" class="sha" data-hotkey="p">afa3e16</a>
</span>
@@ -689,7 +689,7 @@
</div>
<a name="diff-stat"></a>
-
+
<div id='toc' class="details-collapse js-details-container ">
<p class="explain">
<span class="mini-icon mini-icon-diff"></span>Showing <strong>2 changed files</strong>
@@ -720,7 +720,7 @@
</ol>
</div>
-
+
<div id="files" class="diff-view commentable">
<div id="diff-0" class="file js-details-container">
<div class="meta" data-path="django/utils/html.py">
@@ -730,7 +730,7 @@
<span class="js-selectable-text css-truncate css-truncate-target" title="django/utils/html.py">
django/utils/html.py
</span>
-
+
</div>
<div class="actions">
<span class="show-inline-notes">
@@ -868,7 +868,7 @@
<span class="js-selectable-text css-truncate css-truncate-target" title="tests/regressiontests/utils/html.py">
tests/regressiontests/utils/html.py
</span>
-
+
</div>
<div class="actions">
<span class="show-inline-notes">
@@ -1007,7 +1007,7 @@
<div class="discussion-bubble-content bubble">
<div class="discussion-bubble-inner">
<input type='hidden' name='commit_id' value='d7504a3d7b8645bdb979bab7ded0e9a9b6dccd0e'>
-
+
<div class="js-previewable-comment-form previewable-comment-form write-selected" data-preview-url="/preview?repository=4164482">
<div class="comment-form-head tabnav">
@@ -1022,7 +1022,7 @@
<div class="comment-form-error js-comment-form-error" style="display:none;"></div>
<div id="write_bucket_525" class="write-content js-write-bucket js-uploadable-container upload-enabled is-default" data-model="asset">
-
+
<a href="#fullscreen_comment_body_525" class="enable-fullscreen js-enable-fullscreen tooltipped
leftwards " title="Zen Mode">
<span class="mini-icon mini-icon-fullscreen"></span>
@@ -1036,7 +1036,7 @@
data-suggester="525_new_preview_suggester"
required></textarea>
-
+
<p class="drag-and-drop">
<span class="default">
Attach images by dragging &amp; dropping them or
@@ -1059,7 +1059,7 @@
</div>
<div id="preview_bucket_525" class="preview-content js-preview-bucket">
-
+
<div id="openstruct-163168300" class="js-comment comment">
<div class="comment-header normal-comment-header">
<img class="comment-header-gravatar" height="22" src="https://secure.gravatar.com/avatar/cf4198670f0073174b475634964b576b?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="22" />
@@ -1110,7 +1110,7 @@
</div>
-
+
<div class="thread-subscription-status clearfix">
<span class="mega-icon mega-icon-notifications"></span>
@@ -1293,10 +1293,10 @@
<a href="#" class="mini-icon mini-icon-remove-close ajax-error-dismiss"></a>
</div>
-
-
+
+
<span id='server_response_time' data-time='0.09780' data-host='fe2'></span>
-
+
</body>
</html>
diff --git a/tests/utils_tests/files/strip_tags2.txt b/tests/utils_tests/files/strip_tags2.txt
index 6b2a4033c2..331af904ea 100644
--- a/tests/utils_tests/files/strip_tags2.txt
+++ b/tests/utils_tests/files/strip_tags2.txt
@@ -4,31 +4,31 @@ _The code example is available on [github](http://github.com/iontech/Fragments_E
_____________________________________________________________
Ever wanted a code snippet from an Activity to be available to other activities? Perhaps a Button or a ListView, maybe a Layout or any View/ViewGroup for that matter? Fragments let us do just that.
-Necessity is the mother of invention.
+Necessity is the mother of invention.
Before understanding what Fragments are and how they work, we must first realize their existence in the first place.
The Problem
-----------
-Suppose we have an Android app with two Activities- [*FirstActivity*](https://github.com/iontech/Fragments_Example/blob/master/src/main/java/com/github/iontech/fragments_example/FirstActivity.java) and [*SecondActivity*](https://github.com/iontech/Fragments_Example/blob/master/src/main/java/com/github/iontech/fragments_example/SecondActivity.java).
-*FirstActivity* contains two Views, a `TextView` (*textView*) and a `Button` (*button1*); and *button1* has an `onClick()` callback that `Toast`'s a simple message "Button pressed".
+Suppose we have an Android app with two Activities- [*FirstActivity*](https://github.com/iontech/Fragments_Example/blob/master/src/main/java/com/github/iontech/fragments_example/FirstActivity.java) and [*SecondActivity*](https://github.com/iontech/Fragments_Example/blob/master/src/main/java/com/github/iontech/fragments_example/SecondActivity.java).
+*FirstActivity* contains two Views, a `TextView` (*textView*) and a `Button` (*button1*); and *button1* has an `onClick()` callback that `Toast`'s a simple message "Button pressed".
*SecondActivity* contains both the Views present in *FirstActivity* and a `Button` (*button2*).
Now we want to utilize the two layout components(Views) of *FirstActivity* in *SecondActivity*, we can go about this with two approaches:
1. Copy and Paste the xml elements of the two Views.
-2. Create a separate layout for common Views and reuse it using `` layout element.
+2. Create a separate layout for common Views and reuse it using `` layout element.
More about this [here](http://developer.android.com/training/improving-layouts/reusing-layouts.html).
Electing the second approach makes sense cause it enables us to make reusable layouts. Everything seems great till now. We are able to make reusable layouts and use them as many times as we want.
-Now recollect that we have an `onClick()` callback assigned to *button1*. How do we reuse the same callback functionality of *button1* across multiple Activities? `` lets us reuse layouts and not the Activity source.
+Now recollect that we have an `onClick()` callback assigned to *button1*. How do we reuse the same callback functionality of *button1* across multiple Activities? `` lets us reuse layouts and not the Activity source.
This is where Fragments come into play.
Fragments
---------
<center> ![image](http://iontech.files.wordpress.com/2013/01/androidfragmentation1-264x300.png) </center>
Fragments encompass both layout resource and Java source. Hence, unlike ``, they allow us to reuse the View components along with their functionality, if needed.
-Fragments were first introduced in Honeycomb(API 11), living under the `android.app` package.
+Fragments were first introduced in Honeycomb(API 11), living under the `android.app` package.
**Note**: API 11 implies that Fragments have no support for devices less than Honeycomb and, for the record, as of writing this post, [more than 50% of Android devices worldwide run versions of Android below Honeycomb](http://developer.android.com/about/dashboards/index.html). Developer dissapointed? You don't have to be, cause google has been cautious enough to add the Fragment APIs to the support library. Yay!
In the support library Fragment APIs sit in the `android.support.v4.app` package. This post assumes that your `minSdk` support is below API 11. Hence we concentrate on the Fragment APIs of the support library.
@@ -47,13 +47,13 @@ This is done precisely as we do it for our activity layouts. The layout contains
> [fragment_common.xml](https://github.com/iontech/Fragments_Example/blob/master/res/layout/fragment_common.xml)
-
-
-
+
+
+
<button>
-
+
#### 2. Creating reusable Java source
##### Writing the layout's corresponding Fragment class
@@ -71,7 +71,7 @@ Accessing the view elements from the layout is done exactly as we do in an Activ
In Activity we access Views(a Button for our example) as follows
- Button button1 = (Button) findViewById(R.id.button1);
+ Button button1 = (Button) findViewById(R.id.button1);
In Fragment, we need to use the inflated view(if in `onCreateView()`) or get the instance of the host activity and access the views through this instance(when in a [lifecycle callback](http://developer.android.com/guide/components/fragments.html#Lifecycle "Fragment lifecycle callbacks") after `onCreateView()`, I generally do it in `onActivityCreated()`).
Button button1 = (Button) view.findViewById(R.id.button1);
@@ -83,7 +83,7 @@ or
Finally, in `onCreateView()` we must return the View for the fragment's UI.
return view;
-
+
#### 3. Employing the reusable components in Activity
##### Making an Activity to host this Fragment
This is done in two ways, statically by adding `` elements into the Activity layout or dynamically, at run time, by using `FragmentTransaction`s.
@@ -97,7 +97,7 @@ If the `minSdk` is API 11 or higher, then we can leave our inheritance to `Activ
Inorder to statically add a Fragment into your Activity, just add `` element with the necessary layout attributes and the `android:name` attribute set to the fully qualified class name of the corresponding Fragment.
-
+
##### b. Dynamic approach
###### Using `FragmentTransaction`s
diff --git a/tests/utils_tests/test_module/bad_module.py b/tests/utils_tests/test_module/bad_module.py
index cc0cd168ce..69444b0e54 100644
--- a/tests/utils_tests/test_module/bad_module.py
+++ b/tests/utils_tests/test_module/bad_module.py
@@ -1,3 +1,3 @@
import a_package_name_that_does_not_exist
-content = 'Bad Module' \ No newline at end of file
+content = 'Bad Module'
diff --git a/tests/utils_tests/test_module/good_module.py b/tests/utils_tests/test_module/good_module.py
index 0ca689832a..f6261c5bc8 100644
--- a/tests/utils_tests/test_module/good_module.py
+++ b/tests/utils_tests/test_module/good_module.py
@@ -1 +1 @@
-content = 'Good Module' \ No newline at end of file
+content = 'Good Module'
diff --git a/tests/validation/__init__.py b/tests/validation/__init__.py
index 5daa06be66..ba35963744 100644
--- a/tests/validation/__init__.py
+++ b/tests/validation/__init__.py
@@ -13,4 +13,3 @@ class ValidationTestCase(TestCase):
clean()
self.assertIn(field_name, cm.exception.message_dict)
self.assertEqual(message, cm.exception.message_dict[field_name])
-
diff --git a/tests/validation/test_custom_messages.py b/tests/validation/test_custom_messages.py
index 2e259b7aef..b33e232e88 100644
--- a/tests/validation/test_custom_messages.py
+++ b/tests/validation/test_custom_messages.py
@@ -10,4 +10,3 @@ class CustomMessagesTest(ValidationTestCase):
def test_custom_null_message(self):
cmm = CustomMessagesModel()
self.assertFieldFailsValidationWithMessage(cmm.full_clean, 'number', ['NULL'])
-
diff --git a/tests/validation/test_unique.py b/tests/validation/test_unique.py
index bca1b36c93..79b197a262 100644
--- a/tests/validation/test_unique.py
+++ b/tests/validation/test_unique.py
@@ -141,4 +141,3 @@ class PerformUniqueChecksTest(TestCase):
with self.assertRaises(ValidationError) as cm:
m.full_clean()
self.assertEqual(cm.exception.message_dict, {'no': ['Custom unique number message.']})
-
diff --git a/tests/version/tests.py b/tests/version/tests.py
index a5d49fc450..0a40d988bb 100644
--- a/tests/version/tests.py
+++ b/tests/version/tests.py
@@ -24,4 +24,3 @@ class VersionTests(TestCase):
)
for ver_tuple, ver_string in tuples_to_strings:
self.assertEqual(get_version(ver_tuple), ver_string)
-
diff --git a/tests/view_tests/__init__.py b/tests/view_tests/__init__.py
index 1193ffe010..3f16dadae2 100644
--- a/tests/view_tests/__init__.py
+++ b/tests/view_tests/__init__.py
@@ -8,4 +8,3 @@ except_args = (b'Broken!', # plain exception with ASCII text
'¡Broken!', # non-ASCII unicode data
'¡Broken!'.encode('utf-8'), # non-ASCII, utf-8 encoded bytestring
b'\xa1Broken!', ) # non-ASCII, latin1 bytestring
-
diff --git a/tests/view_tests/templatetags/debugtags.py b/tests/view_tests/templatetags/debugtags.py
index 9e1945cb23..5aafc3a9e0 100644
--- a/tests/view_tests/templatetags/debugtags.py
+++ b/tests/view_tests/templatetags/debugtags.py
@@ -8,4 +8,3 @@ register = template.Library()
@register.simple_tag
def go_boom(arg):
raise BrokenException(arg)
-
diff --git a/tests/view_tests/tests/test_specials.py b/tests/view_tests/tests/test_specials.py
index fc1dd98c0e..0b933ac0de 100644
--- a/tests/view_tests/tests/test_specials.py
+++ b/tests/view_tests/tests/test_specials.py
@@ -36,4 +36,3 @@ class URLHandling(TestCase):
"""
response = self.client.get('/permanent_nonascii_redirect/')
self.assertRedirects(response, self.redirect_target, status_code=301)
-