def handle(self, *args, **kwargs): update_all_majors() update_all_schools() self.stdout.write("Updated active schools and majors in database.")
def testProfessionalCount(self, mock_source_file): mock_source_file.return_value.text = self.html update_all_majors() self.assertEquals(Major.objects.filter(degree_type="PROFESSIONAL").count(), 47)
def testBachelorMajorCount(self, mock_source_file): mock_source_file.return_value.text = self.html update_all_majors() self.assertEquals(Major.objects.filter(degree_type="BACHELORS").count(), 215)
def testMasterCount(self, mock_source_file): mock_source_file.return_value.text = self.html update_all_majors() self.assertEquals(Major.objects.filter(degree_type="MASTERS").count(), 123)
def testTotalMajorCount(self, mock_source_file): mock_source_file.return_value.text = self.html update_all_majors() self.assertEquals(Major.objects.all().count(), 469)