Esempio n. 1
0
    def test_enabled(self):
        self.settings.enabled = True

        context = FauxContext()
        view = QueuePurge(context, FauxRequest)
        self.assertEqual('Queued', view())
        self.assertEqual(1, len(self.handler.invocations))
        self.assertTrue(self.handler.invocations[0].object is context)
Esempio n. 2
0
    def test_disabled(self):
        self.settings.enabled = False

        view = QueuePurge(FauxContext(), FauxRequest())
        self.assertEqual('Caching not enabled', view())
        self.assertEqual([], self.handler.invocations)