def test_find_donors_exclude_urban(self):
        other_catchment = Catchment(location="Burn A", watercourse="Village B")
        other_catchment.id = 999
        other_catchment.is_suitable_for_pooling = True
        other_catchment.descriptors = Descriptors(urbext2000=0.031)
        self.db_session.add(other_catchment)

        gauged_catchments = CatchmentCollections(self.db_session)
        analysis = GrowthCurveAnalysis(self.catchment, gauged_catchments)
        analysis.find_donor_catchments()
        donor_ids = [d.id for d in analysis.donor_catchments]
        self.assertEqual([10002, 10001], donor_ids)
    def test_find_donors_exclude_urban(self):
        other_catchment = Catchment(location="Burn A", watercourse="Village B")
        other_catchment.id = 999
        other_catchment.is_suitable_for_pooling = True
        other_catchment.descriptors = Descriptors(urbext2000=0.031)
        self.db_session.add(other_catchment)

        gauged_catchments = CatchmentCollections(self.db_session)
        analysis = GrowthCurveAnalysis(self.catchment, gauged_catchments)
        analysis.find_donor_catchments()
        donor_ids = [d.id for d in analysis.donor_catchments]
        self.assertEqual([10002, 10001], donor_ids)
 def test_find_donors(self):
     gauged_catchments = CatchmentCollections(self.db_session)
     analysis = GrowthCurveAnalysis(self.catchment, gauged_catchments)
     analysis.find_donor_catchments()
     donor_ids = [d.id for d in analysis.donor_catchments]
     self.assertEqual([10002, 10001], donor_ids)
 def test_find_donors_without_collection(self):
     analysis = GrowthCurveAnalysis(self.catchment)
     self.assertFalse(analysis.find_donor_catchments())
 def test_find_donors(self):
     gauged_catchments = CatchmentCollections(self.db_session)
     analysis = GrowthCurveAnalysis(self.catchment, gauged_catchments)
     analysis.find_donor_catchments()
     donor_ids = [d.id for d in analysis.donor_catchments]
     self.assertEqual([10002, 10001], donor_ids)
 def test_find_donors_without_collection(self):
     analysis = GrowthCurveAnalysis(self.catchment)
     self.assertFalse(analysis.find_donor_catchments())