예제 #1
0
    def test_to_son_with_auto_update(self):
        dt = datetime(2010, 11, 12, 13, 14, 15)
        now = datetime.now()
        field = DateTimeField(auto_now_on_update=True)

        expect(field.to_son(field.get_value(dt))).to_be_greater_or_equal_to(now)
예제 #2
0
    def test_to_son_with_auto_insert(self):
        dt = datetime.now()
        field = DateTimeField(auto_now_on_insert=True)

        expect(field.to_son(field.get_value(None))).to_be_greater_or_equal_to(dt)