Exemplo n.º 1
0
 def test_set_delete_fail(self):
     """Test successfull delete."""
     s = AssessSet(TestItemA)
     s.delete("bad_item_id_str")
     msg = "ERROR: Cannot delete item #bad_item_id_str in TestItemA - " + \
         "it does not exist."
     self.assertEqual(s.context['item_list_message'], msg)
Exemplo n.º 2
0
 def test_set_delete_success(self):
     """Test successfull delete."""
     s = AssessSet(TestItemA)
     s.delete("1")
     msg = 'SUCCESS: Deleted item a1 in TestItemA.'
     self.assertEqual(s.context['item_list_message'], msg)
     # Test that item a1 was in fact deleted
     s = AssessSet(TestItemA)
     self.assertEqual(s.labels, ['a2'])
     self.assertEqual(s.labels_by_ids, {2: 'a2'})
     self.assertEqual(s.ids_by_labels, {'a2': 2})
     self.assertEqual(s.items, {'a2': self.a2})