def test_summary_multiple_groups_with_multiple_candidates(self): relatedexaminer = mommy.make('core.RelatedExaminer') testassignment = mommy.make('core.Assignment') testgroup1 = mommy.make('core.AssignmentGroup', parentnode=testassignment) mommy.make('core.Examiner', assignmentgroup=testgroup1, relatedexaminer=relatedexaminer) mommy.make('core.Candidate', assignment_group=testgroup1) mommy.make('core.Candidate', assignment_group=testgroup1) testgroup2 = mommy.make('core.AssignmentGroup', parentnode=testassignment) mommy.make('core.Examiner', assignmentgroup=testgroup2, relatedexaminer=relatedexaminer) mommy.make('core.Candidate', assignment_group=testgroup2) relatedexaminer = self.__annotate_relatedexaminer( relatedexaminer, assignment=testassignment) selector = htmls.S( listbuilder_relatedexaminer.OnassignmentItemValue( value=relatedexaminer).render()) self.assertEqual( '3 students in 2 project groups', selector.one( '.django-cradmin-listbuilder-itemvalue-titledescription-description' ).alltext_normalized)
def test_summary_no_groups(self): relatedexaminer = mommy.make('core.RelatedExaminer') testassignment = mommy.make('core.Assignment') relatedexaminer = self.__annotate_relatedexaminer(relatedexaminer, assignment=testassignment) selector = htmls.S(listbuilder_relatedexaminer.OnassignmentItemValue(value=relatedexaminer).render()) self.assertEqual( 'No students', selector.one('.django-cradmin-listbuilder-itemvalue-titledescription-description').alltext_normalized)
def test_title_with_fullname(self): relatedexaminer = mommy.make('core.RelatedExaminer', user__fullname='Test User', user__shortname='*****@*****.**') testassignment = mommy.make('core.Assignment') relatedexaminer = self.__annotate_relatedexaminer(relatedexaminer, assignment=testassignment) selector = htmls.S(listbuilder_relatedexaminer.OnassignmentItemValue(value=relatedexaminer).render()) self.assertEqual( 'Test User([email protected])', selector.one('.django-cradmin-listbuilder-itemvalue-titledescription-title').alltext_normalized)