Exemplo n.º 1
0
 def test_get_callback_function_import_error(self):
     with self.assertRaises(ImportError):
         get_callback_function("DJSTRIPE_TEST_CALLBACK")
Exemplo n.º 2
0
 def test_get_callback_function_with_valid_func_callable(self):
     func = get_callback_function("DJSTRIPE_TEST_CALLBACK")
     self.assertEqual("ok", func())
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 5
0
 def test_get_callback_function_with_valid_func_callable(self):
     func = get_callback_function("DJSTRIPE_TEST_CALLBACK")
     self.assertEqual("ok", func())
Exemplo n.º 6
0
 def test_get_callback_function_(self):
     with self.assertRaises(ImportError):
         get_callback_function("DJSTRIPE_TEST_CALLBACK")
Exemplo n.º 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')
Exemplo n.º 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')