From 0a47ea3724f8ba9fe4b73e9d9dfd7c1c8d9e2572 Mon Sep 17 00:00:00 2001 From: Anna Sidwell Date: Sun, 2 Dec 2018 00:38:15 +0000 Subject: [PATCH] Nuke no longer needed tests, add youtube one --- apps/map/tests.py | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/apps/map/tests.py b/apps/map/tests.py index d8ff558..77367c0 100644 --- a/apps/map/tests.py +++ b/apps/map/tests.py @@ -83,38 +83,10 @@ class CaseStudyDraftAPITests(TestCase): class CaseStudyTests(TestCase): - def test_get_renewable_generation_detail_when_empty(self): - """get_renewable_generation_detail() should return the empty string.""" + def test_youtube(self): case_study = CaseStudy() - self.assertIs(case_study.get_renewable_generation_detail(), "") + case_study.video = "https://www.youtube.com/watch?v=h2V4-UP7ML0" + self.assertIs(case_study.is_video_youtube(), True) - def test_get_renewable_generation_detail_with_geo(self): - """get_renewable_generation_detail() should return just the description""" - case_study = CaseStudy(generation_technology='GEOT') - self.assertEqual(case_study.get_renewable_generation_detail(), "Geothermal electricity") - - def test_get_renewable_generation_detail_with_wind(self): - """get_renewable_generation_detail() should return the description prefixed with 'wind power'""" - case_study = CaseStudy(generation_technology='SSWE') - self.assertTrue(case_study.get_renewable_generation_detail().startswith("Wind energy")) - - def test_get_renewable_generation_detail_with_other(self): - """get_renewable_generation_detail() should return the detail provided in .generation_technology_other""" - case_study = CaseStudy(generation_technology='OTHR', generation_technology_other='Warp drive') - self.assertEqual(case_study.get_renewable_generation_detail(), "Warp drive") - - def test_get_negative_case_reasons_no_other_1(self): - """Test with case having no 'other' entry""" - case_study = CaseStudy(negative_case_reasons=['VOLR','ALAB']) - self.assertEqual(case_study.get_negative_case_reasons_no_other(), - [ 'Violation of land rights' - , 'Abusive labour practices' - ]) - - def test_get_negative_case_reasons_no_other_2(self): - """Test with case having an 'other' entry""" - case_study = CaseStudy(negative_case_reasons=['VOLR','ALAB','OTHR']) - self.assertEqual(case_study.get_negative_case_reasons_no_other(), - [ 'Violation of land rights' - , 'Abusive labour practices' - ]) + # case_study.video = "https://youtu.be/h2V4-UP7ML0" + # self.assertIs(case_study.is_video_youtube(), True)