Nuke no longer needed tests, add youtube one
This commit is contained in:
parent
23c1279f61
commit
0a47ea3724
@ -83,38 +83,10 @@ class CaseStudyDraftAPITests(TestCase):
|
|||||||
|
|
||||||
class CaseStudyTests(TestCase):
|
class CaseStudyTests(TestCase):
|
||||||
|
|
||||||
def test_get_renewable_generation_detail_when_empty(self):
|
def test_youtube(self):
|
||||||
"""get_renewable_generation_detail() should return the empty string."""
|
|
||||||
case_study = CaseStudy()
|
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):
|
# case_study.video = "https://youtu.be/h2V4-UP7ML0"
|
||||||
"""get_renewable_generation_detail() should return just the description"""
|
# self.assertIs(case_study.is_video_youtube(), True)
|
||||||
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'
|
|
||||||
])
|
|
||||||
|
Loading…
Reference in New Issue
Block a user