Skip to content

Commit

Permalink
oops: find . -type f -name "*.py" -print0 | xargs -0 sed -i "s/render…
Browse files Browse the repository at this point in the history
…()\.content\.decode(utf-8)/render().content.decode('utf-8')/g"
  • Loading branch information
jsnshrmn committed Nov 19, 2019
1 parent b0a6d3b commit 0a9841d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions TWLight/applications/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,10 +1436,10 @@ def _base_test_object_visibility(self, url, view, queryset):
# we'll have to do that before we can check for its content.

# Applications should not be visible to just any coordinator
self.assertNotIn(obj.__str__(), denyResponse.render().content.decode(utf-8))
self.assertNotIn(obj.__str__(), denyResponse.render().content.decode('utf-8'))

# Applications should be visible to the designated coordinator
self.assertIn(obj.__str__(), allowResponse.render().content.decode(utf-8))
self.assertIn(obj.__str__(), allowResponse.render().content.decode('utf-8'))

def test_list_authorization(self):
url = reverse("applications:list")
Expand Down Expand Up @@ -1496,7 +1496,7 @@ def _base_test_deleted_object_visibility(self, url, view, queryset):
for obj in queryset_deleted:
# Deleted applications should not be visible to anyone, even the
# assigned coordinator.
self.assertNotIn(obj.__str__(), response.render().content.decode(utf-8))
self.assertNotIn(obj.__str__(), response.render().content.decode('utf-8'))

def test_list_object_visibility(self):
url = reverse("applications:list")
Expand Down Expand Up @@ -2640,7 +2640,7 @@ def test_form_present_not_restricted(self):
response = views.EvaluateApplicationView.as_view()(
request, pk=self.application.pk
)
self.assertIn("<form", response.render().content.decode(utf-8))
self.assertIn("<form", response.render().content.decode('utf-8'))

def test_form_not_present_restricted(self):
factory = RequestFactory()
Expand All @@ -2656,7 +2656,7 @@ def test_form_not_present_restricted(self):
response = views.EvaluateApplicationView.as_view()(
request, pk=self.restricted_application.pk
)
self.assertNotIn("<form", response.render().content.decode(utf-8))
self.assertNotIn("<form", response.render().content.decode('utf-8'))

def test_deleted_user_app_visibility(self):
# If a user deletes their data, any applications
Expand Down Expand Up @@ -3470,7 +3470,7 @@ def test_restricted_applications_sent(self):
self.partner2.save()

response = views.ListReadyApplicationsView.as_view()(request)
content = response.render().content.decode(utf-8)
content = response.render().content.decode('utf-8')
self.assertIn(self.partner2.company_name, content)
self.assertNotIn(partner3.company_name, content)

Expand Down Expand Up @@ -3502,7 +3502,7 @@ def test_restricted_applications_mark_sent(self):
response = views.SendReadyApplicationsView.as_view()(
request, pk=self.partner2.pk
)
content = response.render().content.decode(utf-8)
content = response.render().content.decode('utf-8')

self.assertIn(self.app2.editor.wp_username, content)
self.assertNotIn(app_restricted.editor.wp_username, content)
Expand Down
6 changes: 3 additions & 3 deletions TWLight/users/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_editor_page_has_editor_data(self):

response = views.EditorDetailView.as_view()(request, pk=self.editor1.pk)

content = response.render().content.decode(utf-8)
content = response.render().content.decode('utf-8')

# This uses default data from EditorFactory, except for the username,
# which is randomly generated (hence has no default).
Expand Down Expand Up @@ -365,8 +365,8 @@ def test_user_home_view_is_editor(self):
# same thing on either page.
self.assertEqual(home_response.status_code, 200)
self.assertEqual(
remove_csrfmiddlewaretoken(home_response.render().content.decode(utf-8)),
remove_csrfmiddlewaretoken(detail_response.render().content.decode(utf-8)),
remove_csrfmiddlewaretoken(home_response.render().content.decode('utf-8')),
remove_csrfmiddlewaretoken(detail_response.render().content.decode('utf-8')),
)

@patch("TWLight.users.views.UserDetailView.as_view")
Expand Down

0 comments on commit 0a9841d

Please sign in to comment.