def test_is_not_top_priority_barrier(self):
     tag_title = "Very Important Thing"
     tag = BarrierTagFactory(title=tag_title, is_top_priority_tag=False)
     barrier = BarrierFactory(tags=(tag, ),
                              status_date=datetime.date.today())
     serialised_data = BarrierCsvExportSerializer(barrier).data
     assert ("is_top_priority" in serialised_data.keys()
             and serialised_data["is_top_priority"] is False)
 def test_delivery_confidence_in_response(self):
     user = create_test_user(sso_user_id=self.sso_creator["user_id"])
     barrier: Barrier = BarrierFactory()
     barrier_progress_update_on_track = BarrierProgressUpdate.objects.create(
         barrier=barrier,
         status=PROGRESS_UPDATE_CHOICES.ON_TRACK,
         created_by=user)
     barrier.progress_updates.add(barrier_progress_update_on_track)
     serialised_data = BarrierCsvExportSerializer(barrier).data
     assert "delivery_confidence" in serialised_data.keys()
    def test_valuation_assessment_midpoint(self):
        impact_level = 6
        barrier = BarrierFactory()
        EconomicImpactAssessmentFactory(barrier=barrier, impact=impact_level)
        serialised_data = BarrierCsvExportSerializer(barrier).data

        expected_midpoint_value = ECONOMIC_ASSESSMENT_IMPACT_MIDPOINTS[
            impact_level]
        assert ("valuation_assessment_midpoint" in serialised_data.keys()
                and serialised_data["valuation_assessment_midpoint"]
                == expected_midpoint_value)
 def test_value_for_is_top_priority_is_bool(self):
     barrier = BarrierFactory()
     serialised_data = BarrierCsvExportSerializer(barrier).data
     assert "is_top_priority" in serialised_data.keys() and isinstance(
         serialised_data["is_top_priority"], bool)
 def test_has_value_for_is_top_priority(self):
     barrier = BarrierFactory()
     serialised_data = BarrierCsvExportSerializer(barrier).data
     assert "is_top_priority" in serialised_data.keys()