Fix linting errors.

This commit is contained in:
Feanil Patel
2019-09-19 17:05:02 -04:00
parent 0c1e18ff53
commit 844acea50e
4 changed files with 18 additions and 6 deletions

View File

@@ -123,8 +123,14 @@ class ReceiptViewTests(UserMixin, ModuleStoreTestCase):
user_message = "There was a problem with this transaction"
system_message = "A system error occurred while processing your payment"
self.assertRegexpMatches(response.content.decode('utf-8'), user_message if is_user_message_expected else system_message)
self.assertNotRegexpMatches(response.content.decode('utf-8'), user_message if not is_user_message_expected else system_message)
self.assertRegexpMatches(
response.content.decode('utf-8'),
user_message if is_user_message_expected else system_message
)
self.assertNotRegexpMatches(
response.content.decode('utf-8'),
user_message if not is_user_message_expected else system_message
)
@with_comprehensive_theme("edx.org")
def test_hide_nav_header(self):

View File

@@ -1310,7 +1310,7 @@ class TestEditorSavedMethod(BaseTestVideoXBlock):
self.MODULESTORE = MODULESTORES[default_store] # pylint: disable=invalid-name
self.initialize_block(metadata=self.metadata)
item = self.store.get_item(self.item_descriptor.location)
with open(self.file_path, "rb") as myfile:
with open(self.file_path, "rb") as myfile: # pylint: disable=open-builtin
save_to_store(myfile.read(), self.file_name, 'text/sjson', item.location)
item.sub = "3_yD_cEKoCk"
# subs_video.srt.sjson does not exist before calling editor_saved function
@@ -1330,7 +1330,7 @@ class TestEditorSavedMethod(BaseTestVideoXBlock):
self.MODULESTORE = MODULESTORES[default_store]
self.initialize_block(metadata=self.metadata)
item = self.store.get_item(self.item_descriptor.location)
with open(self.file_path, "rb") as myfile:
with open(self.file_path, "rb") as myfile: # pylint: disable=open-builtin
save_to_store(myfile.read(), self.file_name, 'text/sjson', item.location)
save_to_store(myfile.read(), 'subs_video.srt.sjson', 'text/sjson', item.location)
item.sub = "3_yD_cEKoCk"