def test_b(self):
        """Test no intake are available for level control.

        There is an intake available for level control but that belongs to
        another open water.
        """
        open_water = OpenWater()
        open_water.pk = 2
        intake = find_pumping_station_level_control(open_water, True)
        self.assertTrue(intake is None)
    def test_e(self):
        """Test no intakes are available for level control.

        There is a pump available for level control.
        """
        self.pumping_station.into = False
        self.pumping_station.save()
        open_water = self.pumping_station.open_water
        intake = find_pumping_station_level_control(open_water, True)
        self.assertTrue(intake is None)
    def test_d(self):
        """Test no intakes are available for level control.

        There is an intake available but that intake cannot be used for level
        control.
        """
        self.pumping_station.computed_level_control = False
        self.pumping_station.save()
        open_water = self.pumping_station.open_water
        intake = find_pumping_station_level_control(open_water, True)
        self.assertTrue(intake is None)
    def test_c(self):
        """Test multiple intakes are available for level control."""

        pumping_station = self.create_pumping_station()
        self.assertEqual(2, PumpingStation.objects.count())

        open_water = pumping_station.open_water
        intake = find_pumping_station_level_control(open_water, True)
        self.assertTrue((intake == self.pumping_station) ^
                        (intake == pumping_station))

        pumping_station.delete()
 def test_a(self):
     """Test one intake is available for level control."""
     open_water = self.pumping_station.open_water
     intake = find_pumping_station_level_control(open_water, True)
     self.assertEqual(self.pumping_station, intake)
def test_no_intakes_or_pumps_exist():
    """Test no intakes or pumps exist."""
    open_water = OpenWater()
    open_water.pk = 1
    intake = find_pumping_station_level_control(open_water, True)
    assert intake is None