Nuke no longer needed tests, add youtube one

This commit is contained in:
Anna Sidwell 2018-12-02 00:38:15 +00:00
parent 23c1279f61
commit 0a47ea3724

View File

@ -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)