Exemplo n.º 1
0
 def test_handle_done_5_with_done_true_and_completed_on_in_past_that_completed_on_remains(self):
     # Completed on shouldn't change if nothing has changed
     actionitem = ActionItem()
     actionitem.completed_on = completed_on = random_date()
     actionitem.done = True
     actionitem = actionitem.handle_done(actionitem)
     assert actionitem.completed_on == completed_on
Exemplo n.º 2
0
 def test_handle_done_3_with_done_set_when_completed_on_has_not_been_set(self):
     # With actionitem.done set, completed on should be set
     actionitem = ActionItem()
     actionitem.done = True
     actionitem = actionitem.handle_done(actionitem)
     delta = actionitem.completed_on - datetime.utcnow().replace(tzinfo=utc)
     assert abs(delta) <= timedelta(milliseconds=10), 'Times are not almost equal'
Exemplo n.º 3
0
 def test_handle_done_2_with_done_null_when_completed_on_has_initial_value(self):
     # With actionitem.done not set, completed on should be forced empty
     actionitem = ActionItem()
     actionitem.completed_on = random_date()
     print actionitem.completed_on
     actionitem = actionitem.handle_done(actionitem)
     assert actionitem.completed_on is None
Exemplo n.º 4
0
 def test_title_2_with_long_description_with_default(self):
     description = random_string(1000)
     actionitem = ActionItem()
     actionitem.description = description
     assert actionitem.title() == description[:140]
Exemplo n.º 5
0
 def test_title_1_with_short_description(self):
     description = random_string(30)
     actionitem = ActionItem()
     actionitem.description = description
     assert actionitem.title() == description
Exemplo n.º 6
0
 def test_handle_done_4_with_done_set_false_removes_completed_on(self):
     # Completed on should be removed if done is false
     actionitem = ActionItem()
     actionitem.completed_on = random_date()
     actionitem = actionitem.handle_done(actionitem)
     assert actionitem.completed_on is None
Exemplo n.º 7
0
 def test_handle_done_1_with_done_null(self):
     # With actionitem.done not set, completed on should be empty
     actionitem = ActionItem()
     actionitem = actionitem.handle_done(actionitem)
     assert actionitem.completed_on is None
Exemplo n.º 8
0
 def test_signal_for_done_status_changed_not_sent_when_new_item_isnt_done(self, signal_sent):
     action_item = ActionItem(done=False)
     action_item.save()
     assert not signal_sent.send.called