Refs #24621 -- Added a test for SessionBase.pop()'s 'default' argument.

This commit is contained in:
Nicolas Noé 2016-04-20 17:04:58 +02:00 committed by Tim Graham
parent 08cd6a0e56
commit 973f393761
1 changed files with 5 additions and 0 deletions

View File

@ -83,6 +83,11 @@ class SessionTestsMixin(object):
self.assertTrue(self.session.accessed)
self.assertFalse(self.session.modified)
def test_pop_default_named_argument(self):
self.assertEqual(self.session.pop('some key', default='does not exist'), 'does not exist')
self.assertTrue(self.session.accessed)
self.assertFalse(self.session.modified)
def test_setdefault(self):
self.assertEqual(self.session.setdefault('foo', 'bar'), 'bar')
self.assertEqual(self.session.setdefault('foo', 'baz'), 'bar')