File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
tests/integration/cqlengine/columns Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -112,3 +112,19 @@ def test_new_instance_defaults_to_zero(self):
112112 instance = TestCounterModel ()
113113 assert instance .counter == 0
114114
115+ def test_save_after_no_update (self ):
116+ expected_value = 15
117+ instance = TestCounterModel .create ()
118+ instance .update (counter = expected_value )
119+
120+ # read back
121+ instance = TestCounterModel .get (partition = instance .partition )
122+ self .assertEqual (instance .counter , expected_value )
123+
124+ # save after doing nothing
125+ instance .save ()
126+ self .assertEqual (instance .counter , expected_value )
127+
128+ # make sure there was no increment
129+ instance = TestCounterModel .get (partition = instance .partition )
130+ self .assertEqual (instance .counter , expected_value )
You can’t perform that action at this time.
0 commit comments