Example #1
0
 def test_get_callback_function_import_error(self):
     with self.assertRaises(ImportError):
         get_callback_function("DJSTRIPE_TEST_CALLBACK")
Example #2
0
 def test_get_callback_function_with_valid_func_callable(self):
     func = get_callback_function("DJSTRIPE_TEST_CALLBACK")
     self.assertEqual("ok", func())
Example #3
0
 def test_get_callback_function_with_valid_string_callable(
         self, import_string_mock):
     func = get_callback_function("DJSTRIPE_TEST_CALLBACK")
     self.assertEqual("ok", func())
     import_string_mock.assert_called_with('foo.valid_callback')
Example #4
0
 def test_get_callback_function_with_non_callable_string(
         self, import_string_mock):
     with self.assertRaises(ImproperlyConfigured):
         get_callback_function("DJSTRIPE_TEST_CALLBACK")
     import_string_mock.assert_called_with('foo.invalid_callback')
Example #5
0
 def test_get_callback_function_with_valid_func_callable(self):
     func = get_callback_function("DJSTRIPE_TEST_CALLBACK")
     self.assertEqual("ok", func())
Example #6
0
 def test_get_callback_function_(self):
     with self.assertRaises(ImportError):
         get_callback_function("DJSTRIPE_TEST_CALLBACK")
Example #7
0
 def test_get_callback_function_with_non_callable_string(self, import_string_mock):
     with self.assertRaises(ImproperlyConfigured):
         get_callback_function("DJSTRIPE_TEST_CALLBACK")
     import_string_mock.assert_called_with('foo.invalid_callback')
Example #8
0
 def test_get_callback_function_with_valid_string_callable(self, import_string_mock):
     func = get_callback_function("DJSTRIPE_TEST_CALLBACK")
     self.assertEqual("ok", func())
     import_string_mock.assert_called_with('foo.valid_callback')