Exemple #1
0
class BaseSessionTests(unittest.TestCase):
    def setUp(self):
        super(BaseSessionTests, self).setUp()
        self.session = BaseSession()

    def test_unmodified_by_default(self):
        self.assertFalse(self.session.modified)

    def test_setting_value(self):
        self.session["key"] = "value"
        self.assertEqual(self.session["key"], "value")
        self.assertTrue("key" in self.session)

    def test_deleting_value(self):
        self.session["key"] = "value"
        del self.session["key"]
        self.assertFalse("key" in self.session)

    def test_clearing(self):
        self.session["key"] = "value"
        self.session.clear()
        self.assertFalse("key" in self.session)
Exemple #2
0
 def setUp(self):
     super(BaseSessionTests, self).setUp()
     self.session = BaseSession()