Exemple #1
0
    def setUp(self):
        super(PaymentProcessorListViewTests, self).setUp()
        self.token = self.generate_jwt_token_header(self.create_user())
        self.toggle_payment_processor(DummyProcessor.NAME, True)
        self.toggle_payment_processor(AnotherDummyProcessor.NAME, True)

        site_config, __ = SiteConfiguration.objects.get_or_create(site__id=1)

        old_payment_processors = site_config.payment_processors
        site_config.payment_processors = ",".join(
            [DummyProcessor.NAME, AnotherDummyProcessor.NAME])
        site_config.save()

        def reset_site_config():
            """ Reset method - resets site_config to pre-test state """
            site_config.payment_processors = old_payment_processors
            site_config.save()

        self.addCleanup(reset_site_config)

        # Clear the view cache
        TieredCache.clear_all_tiers()
Exemple #2
0
 def tearDown(self):
     TieredCache.clear_all_tiers()
     super(TieredCacheMixin, self).tearDown()
Exemple #3
0
 def setUp(self):
     TieredCache.clear_all_tiers()
     super(TieredCacheMixin, self).setUp()
Exemple #4
0
 def setUp(self):
     TieredCache.clear_all_tiers()
Exemple #5
0
 def test_clear_all_tiers(self, mock_cache_clear):
     TieredCache.set_all_tiers(TEST_KEY, EXPECTED_VALUE)
     TieredCache.clear_all_tiers()
     self.assertTrue(RequestCache.get_cached_response(TEST_KEY).is_miss)
     mock_cache_clear.assert_called_once_with()
Exemple #6
0
 def setUp(self):
     super(DiscoveryMockMixin, self).setUp()
     TieredCache.clear_all_tiers()