(self)
| 397 | eq_(f1.data, {"c": "d"}) |
| 398 | |
| 399 | def test_popitem(self): |
| 400 | sess = fixture_session() |
| 401 | |
| 402 | orig = {"a": "b", "c": "d"} |
| 403 | |
| 404 | # the orig dict remains unchanged when we assign, |
| 405 | # but just making this future-proof |
| 406 | data = dict(orig) |
| 407 | f1 = Foo(data=data) |
| 408 | sess.add(f1) |
| 409 | sess.commit() |
| 410 | |
| 411 | k, v = f1.data.popitem() |
| 412 | assert k in ("a", "c") |
| 413 | orig.pop(k) |
| 414 | |
| 415 | sess.commit() |
| 416 | |
| 417 | eq_(f1.data, orig) |
| 418 | |
| 419 | def test_setdefault(self): |
| 420 | sess = fixture_session() |