def test_program_creation_empty_data(self): """Check that update_programs bails when there's no data.""" empty_program_data = { 'latest.programs.cip_4_digit': [self.empty_mock_program_data] } count = update_colleges.update_programs( empty_program_data, self.school) self.assertEqual(count, 0)
def test_program_creation_success(self): """Check the update_programs succeeds with good data.""" api_data = {'latest.programs.cip_4_digit': [self.mock_program_data]} count = update_colleges.update_programs(api_data, self.school) self.assertEqual(count, 1) self.assertTrue( Program.objects.filter(institution=self.school, program_code='5101-5').exists())