33from mock import patch , Mock
44
55from td .models import Language , JSONData
6- from td .tasks import reset_langnames_cache , update_langnames_data , post_to_ext_apps , notify_external_apps
6+ from td .tasks import reset_langnames_cache , update_langnames_data , post_to_ext_app , notify_external_apps
77from td .tests .models import NoSignalTestCase
88
99
@@ -99,7 +99,7 @@ def test_update_langnames_data(self):
9999 self .assertIn ("ld" , json )
100100
101101
102- class PostToExtAppsTestCase (TestCase ):
102+ class PostToExtAppTestCase (TestCase ):
103103 def setUp (self ):
104104 self .patcher_post = patch ("td.tasks.requests.post" )
105105 self .patcher_send_mail = patch ("td.tasks.send_mail" )
@@ -119,7 +119,7 @@ def test_accepted_with_no_message(self):
119119 response = {"status_code" : 202 , "content" : "" }
120120 self .mock_response .configure_mock (** response )
121121
122- post_to_ext_apps ("fake_url" , "fake_data" , "fake_headers" )
122+ post_to_ext_app ("fake_url" , "fake_data" , "fake_headers" )
123123
124124 self .mock_post .assert_called_once_with ("fake_url" , data = "fake_data" , headers = "fake_headers" )
125125 self .assertFalse (self .mock_send_mail .called )
@@ -131,7 +131,7 @@ def test_accepted_with_message(self):
131131 response = {"status_code" : 202 , "content" : "something's wrong" }
132132 self .mock_response .configure_mock (** response )
133133
134- post_to_ext_apps ("fake_url" , "fake_data" , "fake_headers" )
134+ post_to_ext_app ("fake_url" , "fake_data" , "fake_headers" )
135135
136136 self .mock_post .assert_called_once_with ("fake_url" , data = "fake_data" , headers = "fake_headers" )
137137 self .assertEqual (self .mock_send_mail .call_count , 1 )
@@ -143,7 +143,7 @@ def test_not_accepted(self):
143143 response = {"status_code" : 403 }
144144 self .mock_response .configure_mock (** response )
145145
146- post_to_ext_apps ("fake_url" , "fake_data" , "fake_headers" )
146+ post_to_ext_app ("fake_url" , "fake_data" , "fake_headers" )
147147
148148 self .mock_post .assert_called_once_with ("fake_url" , data = "fake_data" , headers = "fake_headers" )
149149 self .assertEqual (self .mock_send_mail .call_count , 1 )
@@ -283,7 +283,7 @@ def test_bad_ext_app_setting(self, mock_settings):
283283 self .assertGreater (len (status .message ), 0 )
284284
285285 @patch ("td.tasks.settings" )
286- @patch ("td.tasks.post_to_ext_apps .delay" )
286+ @patch ("td.tasks.post_to_ext_app .delay" )
287287 def test_no_ext_apps (self , mock_async_post , mock_settings ):
288288 """
289289 If called with the right arguments but no ext apps, function should return success status and post should
@@ -297,7 +297,7 @@ def test_no_ext_apps(self, mock_async_post, mock_settings):
297297 self .assertFalse (mock_async_post .called )
298298
299299 @patch ("td.tasks.settings" )
300- @patch ("td.tasks.post_to_ext_apps .delay" )
300+ @patch ("td.tasks.post_to_ext_app .delay" )
301301 def test_with_ext_apps (self , mock_async_post , mock_settings ):
302302 """
303303 If called with the right arguments and ext app settings, function should return success status, no message
0 commit comments