def test_global_api_keys_test_mode(self): reload(djstripe_settings) self.assertEqual(djstripe_settings.STRIPE_LIVE_MODE, False) self.assertEqual(djstripe_settings.STRIPE_SECRET_KEY, "sk_test_foo") self.assertEqual(djstripe_settings.TEST_API_KEY, "sk_test_foo") self.assertEqual( models.StripeModel(livemode=False).default_api_key, "sk_test_foo")
def test_secret_key_test_mode(self): del settings.STRIPE_SECRET_KEY del settings.STRIPE_PUBLIC_KEY reload(djstripe_settings) self.assertEqual(djstripe_settings.STRIPE_LIVE_MODE, False) self.assertEqual(djstripe_settings.STRIPE_SECRET_KEY, "sk_test_foo") self.assertEqual(djstripe_settings.STRIPE_PUBLIC_KEY, "pk_test_foo") self.assertEqual(djstripe_settings.TEST_API_KEY, "sk_test_foo") self.assertEqual( models.StripeModel(livemode=False).default_api_key, "sk_test_foo")
def test_api_key_live_mode(self): del settings.STRIPE_SECRET_KEY, settings.STRIPE_TEST_SECRET_KEY del settings.STRIPE_PUBLIC_KEY, settings.STRIPE_TEST_PUBLIC_KEY reload(djstripe_settings) self.assertEqual(djstripe_settings.STRIPE_LIVE_MODE, True) self.assertEqual(djstripe_settings.STRIPE_SECRET_KEY, "sk_live_foo") self.assertEqual(djstripe_settings.STRIPE_PUBLIC_KEY, "pk_live_foo") self.assertEqual(djstripe_settings.LIVE_API_KEY, "sk_live_foo") self.assertEqual( models.StripeModel(livemode=True).default_api_key, "sk_live_foo")