示例#1
0
 def test_id_already_exists(self) -> None:
     """Test exception on alert `id` already exists."""
     with pytest.raises(IntegrityError):
         Alert.add({'id': 1, 'observation_id': 11,  # NOTE: observation_id=11 is a forecast
                    'data': {}})
示例#2
0
 def test_observation_already_exists(self) -> None:
     """Test exception on alert `observation_id` already exists."""
     with pytest.raises(IntegrityError):
         Alert.add({'id': -1, 'observation_id': 1, 'data': {}})