def test_import(self): '''Test that the admin panel can import Assignments.''' models.new_superuser(username='******', password='******') self.client.login(username='******', password='******') registration = models.new_registration() cm1 = models.new_committee(name='SPD') cm2 = models.new_committee(name='USS') co1 = models.new_country(name="Côte d'Ivoire") co2 = models.new_country(name='Barbara Boxer') f = TestFiles.new_csv([ ['Test School', 'SPD', "Côte d'Ivoire"], ['Test School', 'USS', 'Barbara Boxer'] ]) with closing(f) as f: self.client.post(reverse('admin:core_assignment_load'), {'csv': f}) self.assertTrue( Assignment.objects.filter( registration=registration, committee=Committee.objects.get(name='SPD'), country=Country.objects.get(name="Côte d'Ivoire")).exists()) self.assertTrue( Assignment.objects.filter( registration=registration, committee=Committee.objects.get(name='USS'), country=Country.objects.get(name='Barbara Boxer')).exists())
def test_import(self): '''Test that the admin panel can import delegates. ''' models.new_superuser(username='******', password='******') self.client.login(username='******', password='******') school = models.new_school() cm1 = models.new_committee(name='SPD') cm2 = models.new_committee(name='USS') co1 = models.new_country(name="Côte d'Ivoire") co2 = models.new_country(name='Barbara Boxer') Assignment.objects.create(committee=cm1, country=co1, school=school) Assignment.objects.create(committee=cm2, country=co2, school=school) f = TestFiles.new_csv([ ['Name', 'Committee', 'Country', 'School'], ['John Doe', 'SPD', "Côte d'Ivoire", 'Test School'], ['Jane Doe', 'USS', 'Barbara Boxer', 'Test School'], ]) with closing(f) as f: self.client.post(reverse('admin:core_delegate_load'), {'csv': f}) self.assertTrue( Delegate.objects.filter(assignment=Assignment.objects.get( school=School.objects.get(name='Test School'), committee=Committee.objects.get(name='SPD'), country=Country.objects.get(name="Côte d'Ivoire")), name='John Doe').exists()) self.assertTrue( Delegate.objects.filter(assignment=Assignment.objects.get( school=School.objects.get(name='Test School'), committee=Committee.objects.get(name='USS'), country=Country.objects.get(name='Barbara Boxer')), name='Jane Doe').exists())
def setUp(self): self.committee_1 = models.new_committee(name='UNSC') self.feedback_1 = models.new_committee_feedback( committee=self.committee_1, comment='Good') self.committee_2 = models.new_committee(name='HSC') self.feedback_2 = models.new_committee_feedback( committee=self.committee_2, comment='Not Good') self.assignment_1 = models.new_assignment(committee=self.committee_1)
def setUp(self): self.committee_1 = models.new_committee(name='CYBER') self.committee_2 = models.new_committee(name='UNPBC') self.assignment = models.new_assignment(committee=self.committee_1) self.delegate = models.new_delegate(assignment=self.assignment) self.params = { 'comment': "I never got called on ever. SAD!", 'committee': self.committee_1.id }
def setUp(self): self.committee_1 = models.new_committee(name='DISC') self.committee_2 = models.new_committee(name='SOCHUM') self.feedback_1 = models.new_committee_feedback( committee=self.committee_1, comment='Good') self.feedback_2 = models.new_committee_feedback( committee=self.committee_1, comment="Not so good") self.feedback_3 = models.new_committee_feedback( committee=self.committee_2, comment="Awful") self.assignment_1 = models.new_assignment(committee=self.committee_1)
def setUp(self): self.name1 = "Shayna" self.is_head_chair1 = True self.committee1 = models.new_committee() self.name2 = "AD" self.is_head_chair2 = False self.committee2 = models.new_committee() self.sm1 = models.new_secretariat_member( name=self.name1, committee=self.committee1, is_head_chair=self.is_head_chair1) self.sm2 = models.new_secretariat_member( name=self.name2, committee=self.committee2)
def setUp(self): self.user = models.new_user(username='******', password='******') self.school = models.new_school(user=self.user) self.country = models.new_country() self.committee1 = models.new_committee() self.committee2 = models.new_committee() self.assignment1 = Assignment.objects.create( committee=self.committee1, country=self.country, school=self.school, ) self.assignment2 = Assignment.objects.create( committee=self.committee2, country=self.country, school=self.school, )
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.chair = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR) self.delegate_user = models.new_user( username='******', password='******', user_type=User.TYPE_DELEGATE) self.delegate_user_2 = models.new_user( username='******', password='******', user_type=User.TYPE_DELEGATE) self.school = models.new_school(user=self.advisor) self.registration = models.new_registration(school=self.school) self.rubric = models.new_rubric() self.committee = models.new_committee( user=self.chair, rubric=self.rubric) self.paper = models.new_position_paper() self.assignment = models.new_assignment( registration=self.registration, committee=self.committee, paper=self.paper) self.delegate = models.new_delegate( user=self.delegate_user, assignment=self.assignment, school=self.school)
def test_update_assignments(self): '''It should correctly update the set of country assignments.''' cm1 = models.new_committee(name='CM1') cm2 = models.new_committee(name='CM2') ct1 = models.new_country(name='CT1') ct2 = models.new_country(name='CT2') ct3 = models.new_country(name='CT3') s1 = models.new_school(name='S1') r1 = models.new_registration(school=s1) s2 = models.new_school(name='S2') r2 = models.new_registration(school=s2) Assignment.objects.bulk_create([ Assignment(committee_id=cm.id, country_id=ct.id, registration_id=r1.id) for ct in [ct1, ct2] for cm in [cm1, cm2] ]) a = Assignment.objects.get(committee_id=cm2.id, country_id=ct2.id) d1 = models.new_delegate(school=s1, assignment=a) d2 = models.new_delegate(school=s1, assignment=a) # TODO: Also assert on delegate deletion. updates = [ (cm1, ct1, s1, False), (cm1, ct2, s1, False), (cm1, ct3, s1, False), # ADDED # (cm2, ct1, s1), # DELETED (cm2, ct2, s2, False), # UPDATED (cm2, ct3, s2, False), # ADDED ] all_assignments = [ (cm1.id, ct1.id, r1.id, False), (cm1.id, ct2.id, r1.id, False), (cm1.id, ct3.id, r1.id, False), (cm2.id, ct2.id, r2.id, False), (cm2.id, ct3.id, r2.id, False), (cm2.id, ct1.id, r1.id, False), ] Assignment.update_assignments(updates) assignments = [a[1:-1] for a in Assignment.objects.all().values_list()] delegates = Delegate.objects.all() self.assertEquals(set(all_assignments), set(assignments)) self.assertEquals(len(delegates), 2)
def setUp(self): self.name = "Shayna" self.is_head_chair = True self.committee = models.new_committee() self.sm1 = models.new_secretariat_member( name=self.name, committee=self.committee, is_head_chair=self.is_head_chair)
def setUp(self): self.user = models.new_user(username='******', password='******') self.school = models.new_school(user=self.user) self.committee = models.new_committee() self.country = models.new_country() self.params['committee'] = self.committee.id self.params['school'] = self.school.id self.params['country'] = self.country.id
def test_update_assignments(self): '''It should correctly update the set of country assignments.''' cm1 = models.new_committee(name='CM1') cm2 = models.new_committee(name='CM2') ct1 = models.new_country(name='CT1') ct2 = models.new_country(name='CT2') ct3 = models.new_country(name='CT3') s1 = models.new_school(name='S1') r1 = models.new_registration(school=s1) s2 = models.new_school(name='S2') r2 = models.new_registration(school=s2) Assignment.objects.bulk_create([ Assignment( committee_id=cm.id, country_id=ct.id, registration_id=r1.id) for ct in [ct1, ct2] for cm in [cm1, cm2] ]) a = Assignment.objects.get(committee_id=cm2.id, country_id=ct2.id) d1 = models.new_delegate(school=s1, assignment=a) d2 = models.new_delegate(school=s1, assignment=a) # TODO: Also assert on delegate deletion. updates = [ (cm1, ct1, s1, False), (cm1, ct2, s1, False), (cm1, ct3, s1, False), # ADDED # (cm2, ct1, s1), # DELETED (cm2, ct2, s2, False), # UPDATED (cm2, ct3, s2, False), # ADDED ] all_assignments = [ (cm1.id, ct1.id, r1.id, False), (cm1.id, ct2.id, r1.id, False), (cm1.id, ct3.id, r1.id, False), (cm2.id, ct2.id, r2.id, False), (cm2.id, ct3.id, r2.id, False), (cm2.id, ct1.id, r1.id, False), ] Assignment.update_assignments(updates) assignments = [a[1:-1] for a in Assignment.objects.all().values_list()] delegates = Delegate.objects.all() self.assertEquals(set(all_assignments), set(assignments)) self.assertEquals(len(delegates), 2)
def test_anonymous_user(self): '''Anyone should be able to access a list of all the committees.''' c1 = models.new_committee(name='DISC', delegation_size=100) c2 = models.new_committee(name='JCC', special=True, delegation_size=30) response = self.get_response() for r in response.data: r.pop('rubric') self.assertEqual(response.data, [ {'delegation_size': c1.delegation_size, 'special': c1.special, 'id': c1.id, 'full_name': c1.full_name, 'name': c1.name}, {'delegation_size': c2.delegation_size, 'special': c2.special, 'id': c2.id, 'full_name': c2.full_name, 'name': c2.name} ])
def setUp(self): self.committee_1 = models.new_committee(name='CYBER') self.committee_2 = models.new_committee(name='UNPBC') self.assignment_1 = models.new_assignment(committee=self.committee_1) self.assignment_2 = models.new_assignment(committee=self.committee_2) self.delegate_1 = models.new_delegate(assignment=self.assignment_1) self.delegate_2 = models.new_delegate(assignment=self.assignment_2) self.params = { 'comment': "I never got called on ever. SAD!", 'committee': self.committee_1.id, 'rating': 4, 'chair_1_name': "Jake Tibbetts", 'chair_1_comment': "He was the head chair", 'chair_1_rating': 10, 'chair_2_name': "Trent", 'chair_2_comment': "He was the funny one", 'chair_2_rating': 3, 'chair_3_name': "Suchi", 'chair_3_comment': "She was the cute one", 'chair_3_rating': 8, 'chair_4_name': "Nikhil", 'chair_4_comment': "He was the baby", 'chair_4_rating': 1, 'chair_5_name': "", 'chair_5_comment': "", 'chair_5_rating': 0, 'chair_6_name': "", 'chair_6_comment': "", 'chair_6_rating': 0, 'chair_7_name': "", 'chair_7_comment': "", 'chair_7_rating': 0, 'chair_8_name': "", 'chair_8_comment': "", 'chair_8_rating': 0, 'chair_9_name': "", 'chair_9_comment': "", 'chair_9_rating': 0, 'chair_10_name': "", 'chair_10_comment': "", 'chair_10_rating': 0 }
def test_import(self): '''Test that the admin panel can import delegates. ''' models.new_superuser(username='******', password='******') self.client.login(username='******', password='******') registration = models.new_registration() cm1 = models.new_committee(name='SPD') cm2 = models.new_committee(name='USS') co1 = models.new_country(name="Côte d'Ivoire") co2 = models.new_country(name='Barbara Boxer') Assignment.objects.create( committee=cm1, country=co1, registration=registration) Assignment.objects.create( committee=cm2, country=co2, registration=registration) f = TestFiles.new_csv([ ['Name', 'Committee', 'Country', 'School'], ['John Doe', 'SPD', "Côte d'Ivoire", 'Test School'], ['Jane Doe', 'USS', 'Barbara Boxer', 'Test School'], ]) with closing(f) as f: self.client.post(reverse('admin:core_delegate_load'), {'csv': f}) self.assertTrue( Delegate.objects.filter( assignment=Assignment.objects.get( registration=registration, committee=Committee.objects.get(name='SPD'), country=Country.objects.get(name="Côte d'Ivoire")), name='John Doe').exists()) self.assertTrue( Delegate.objects.filter( assignment=Assignment.objects.get( registration=registration, committee=Committee.objects.get(name='USS'), country=Country.objects.get(name='Barbara Boxer')), name='Jane Doe').exists())
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.chair = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR) self.school = models.new_school(user=self.advisor) self.registration = models.new_registration(school=self.school) self.committee = models.new_committee(user=self.chair) self.country = models.new_country() self.delegate_user = models.new_user( username='******', password='******', user_type=User.TYPE_DELEGATE) self.params['committee'] = self.committee.id self.params['registration'] = self.registration.id self.params['country'] = self.country.id
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.advisor2 = models.new_user( username='******', password='******') self.chair = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR) self.delegate_user = models.new_user( username='******', password='******', user_type=User.TYPE_DELEGATE) self.school = models.new_school(user=self.advisor) self.school2 = models.new_school(user=self.advisor2) self.registration = models.new_registration(school=self.school) self.registration2 = models.new_registration(school=self.school2) self.committee = models.new_committee(user=self.chair) self.assignment1 = models.new_assignment( registration=self.registration, committee=self.committee) self.assignment2 = models.new_assignment( registration=self.registration) self.assignment3 = models.new_assignment( registration=self.registration2, committee=self.committee) self.new_assignment = models.new_assignment( registration=self.registration) self.new_assignment2 = models.new_assignment( registration=self.registration2) self.faulty_assignment = models.new_assignment() self.delegate1 = models.new_delegate( name="Nathaniel Parke", school=self.school, assignment=self.assignment1) self.delegate2 = models.new_delegate( name='Trevor Dowds', school=self.school, assignment=self.assignment2) self.delegate3 = models.new_delegate( name='Kunal Mehta', school=self.school2, assignment=self.assignment3) self.params = [ {'id': self.delegate1.id, 'assignment': self.new_assignment.id}, {'id': self.delegate2.id, 'assignment': None} ]
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.chair = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR) self.delegate_user = models.new_user( username='******', password='******', user_type=User.TYPE_DELEGATE) self.school = models.new_school(user=self.advisor) self.registration = models.new_registration(school=self.school) self.committee = models.new_committee(user=self.chair) self.a1 = models.new_assignment( registration=self.registration, committee=self.committee) self.a2 = models.new_assignment( registration=self.registration, committee=self.committee) self.a3 = models.new_assignment()
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.advisor2 = models.new_user( username='******', password='******') self.chair = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR) self.delegate_user = models.new_user( username='******', password='******', user_type=User.TYPE_DELEGATE) self.school = models.new_school(user=self.advisor) self.school2 = models.new_school(user=self.advisor2) self.registration = models.new_registration(school=self.school) self.registration2 = models.new_registration(school=self.school2) self.committee = models.new_committee(user=self.chair) self.assignment = models.new_assignment( registration=self.registration, committee=self.committee) self.params['assignment'] = self.assignment.id self.params['school'] = self.school.id
def test_chair(self): '''Tests chair can get secretariat information''' self.chair_committee = models.new_committee() self.user = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR, committee_id=self.chair_committee.id, ) self.client.login(username='******', password='******') response1 = self.get_response() self.assertEqual(response1.data, []) params2 = {'committee_id': self.empty_committee.id} response2 = self.get_response(params=params2) self.assertEqual(response2.data, []) params3 = {'committee_id': self.committee1.id} response3 = self.get_response(params=params3) self.assertEqual(response3.data, [ { 'id': self.sm1.id, 'name': self.name1, 'committee': self.committee1.id, 'is_head_chair': self.is_head_chair1 }, { 'id': self.sm3.id, 'name': self.name3, 'committee': self.committee1.id, 'is_head_chair': self.is_head_chair3 } ]) params4 = {'committee_id': self.committee2.id} resposne4 = self.get_response(params=params4) self.assertEqual(resposne4.data, [ { 'id': self.sm2.id, 'name': self.name2, 'committee': self.committee2.id, 'is_head_chair': self.is_head_chair2 } ])
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.chair = models.new_user(username='******', password='******', user_type=User.TYPE_CHAIR) self.delegate_user = models.new_user(username='******', password='******', user_type=User.TYPE_DELEGATE) self.school = models.new_school(user=self.advisor) self.registration = models.new_registration(school=self.school) self.committee = models.new_committee(user=self.chair) self.assignment1 = models.new_assignment( registration=self.registration, committee=self.committee) self.assignment2 = models.new_assignment( registration=self.registration) self.delegate1 = models.new_delegate(assignment=self.assignment1, ) self.delegate2 = models.new_delegate(assignment=self.assignment2, name='Trevor Dowds', email='*****@*****.**', summary='Good!')
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.chair = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR) self.delegate_user = models.new_user( username='******', password='******', user_type=User.TYPE_DELEGATE) self.school = models.new_school(user=self.advisor) self.registration = models.new_registration(school=self.school) self.committee = models.new_committee(user=self.chair) self.assignment1 = models.new_assignment( registration=self.registration, committee=self.committee) self.assignment2 = models.new_assignment( registration=self.registration) self.delegate1 = models.new_delegate(assignment=self.assignment1, ) self.delegate2 = models.new_delegate( assignment=self.assignment2, name='Trevor Dowds', email='*****@*****.**', summary='Good!')
def setUp(self): self.advisor = models.new_user(username='******', password='******') self.chair = models.new_user(username='******', password='******', user_type=User.TYPE_CHAIR) self.delegate_user = models.new_user(username='******', password='******', user_type=User.TYPE_DELEGATE) self.delegate_user_2 = models.new_user(username='******', password='******', user_type=User.TYPE_DELEGATE) self.school = models.new_school(user=self.advisor) self.registration = models.new_registration(school=self.school) self.committee = models.new_committee(user=self.chair) self.paper = models.new_position_paper() self.assignment = models.new_assignment(registration=self.registration, committee=self.committee, paper=self.paper) self.delegate = models.new_delegate(user=self.delegate_user, assignment=self.assignment, school=self.school)
def test_import(self): '''Test that the admin panel can import committees.''' models.new_superuser(username='******', password='******') self.client.login(username='******', password='******') committee = models.new_committee(name='ICJ') f = TestFiles.new_csv([['Trent Gomberg', 'ICJ', ''], ['Ali Maloney', 'ICJ', 'TRUE']]) with closing(f) as f: self.client.post(reverse('admin:core_secretariatmember_load'), {'csv': f}) self.assertTrue( SecretariatMember.objects.filter(name='Trent Gomberg', committee=committee.id, is_head_chair=False).exists()) self.assertTrue( SecretariatMember.objects.filter(name='Ali Maloney', committee=committee.id, is_head_chair=True).exists())
def test_chair(self): '''Tests chair can get secretariat information''' self.chair_committee = models.new_committee() self.user = models.new_user( username='******', password='******', user_type=User.TYPE_CHAIR, committee_id=self.chair_committee.id, ) self.client.login(username='******', password='******') response = self.get_response() self.assertEqual(response.data, [ { 'id': self.sm1.id, 'name': self.name1, 'committee': self.committee1.id, 'is_head_chair': self.is_head_chair1 }, { 'id': self.sm2.id, 'name': self.name2, 'committee': self.committee2.id, 'is_head_chair': self.is_head_chair2 } ])
def test_import(self): '''Test that the admin panel can import committees.''' models.new_superuser(username='******', password='******') self.client.login(username='******', password='******') committee = models.new_committee(name='ICJ') f = TestFiles.new_csv([ ['Trent Gomberg', 'ICJ', ''], ['Ali Maloney', 'ICJ', 'TRUE'] ]) with closing(f) as f: self.client.post( reverse('admin:core_secretariatmember_load'), {'csv': f}) self.assertTrue( SecretariatMember.objects.filter( name='Trent Gomberg', committee=committee.id, is_head_chair=False).exists()) self.assertTrue( SecretariatMember.objects.filter( name='Ali Maloney', committee=committee.id, is_head_chair=True).exists())
def setUp(self): self.committee = models.new_committee()
def setUp(self): self.rubric = Rubric.objects.create() self.committee = models.new_committee(rubric=self.rubric)
def setUp(self): self.committee_1 = models.new_committee(name='UNSC') self.committee_2 = models.new_committee(name='HSC') self.params1 = { 'comment': "I never got called on ever. SAD!", 'rating': 4, 'chair_1_name': "Jake Tibbetts", 'chair_1_comment': "He was the head chair", 'chair_1_rating': 10, 'chair_2_name': "Trent", 'chair_2_comment': "He was the funny one", 'chair_2_rating': 3, 'chair_3_name': "Suchi", 'chair_3_comment': "She was the cute one", 'chair_3_rating': 8, 'chair_4_name': "Nikhil", 'chair_4_comment': "He was the baby", 'chair_4_rating': 1, 'chair_5_name': "", 'chair_5_comment': "", 'chair_5_rating': 0, 'chair_6_name': "", 'chair_6_comment': "", 'chair_6_rating': 0, 'chair_7_name': "", 'chair_7_comment': "", 'chair_7_rating': 0, 'chair_8_name': "", 'chair_8_comment': "", 'chair_8_rating': 0, 'chair_9_name': "", 'chair_9_comment': "", 'chair_9_rating': 0, 'chair_10_name': "", 'chair_10_comment': "", 'chair_10_rating': 0 } self.params2 = { 'comment': "Not Good", 'rating': 3, 'chair_1_name': "Jak Tibetts", 'chair_1_comment': "He was a literal chair", 'chair_1_rating': 8, 'chair_2_name': "Tent Gumberg", 'chair_2_comment': "He was the gummy one", 'chair_2_rating': 4, 'chair_3_name': "Suchi Luchi", 'chair_3_comment': "She was the muchi one", 'chair_3_rating': 6, 'chair_4_name': "Nikhil the pill", 'chair_4_comment': "He was the still just the baby", 'chair_4_rating': 2, 'chair_5_name': "", 'chair_5_comment': "", 'chair_5_rating': 0, 'chair_6_name': "", 'chair_6_comment': "", 'chair_6_rating': 0, 'chair_7_name': "", 'chair_7_comment': "", 'chair_7_rating': 0, 'chair_8_name': "", 'chair_8_comment': "", 'chair_8_rating': 0, 'chair_9_name': "", 'chair_9_comment': "", 'chair_9_rating': 0, 'chair_10_name': "", 'chair_10_comment': "", 'chair_10_rating': 0 } self.feedback_1 = models.new_committee_feedback( committee=self.committee_1, comment=self.params1['comment'], rating=self.params1['rating'], chair_1_name=self.params1['chair_1_name'], chair_1_comment=self.params1['chair_1_comment'], chair_1_rating=self.params1['chair_1_rating'], chair_2_name=self.params1['chair_2_name'], chair_2_comment=self.params1['chair_2_comment'], chair_2_rating=self.params1['chair_2_rating'], chair_3_name=self.params1['chair_3_name'], chair_3_comment=self.params1['chair_3_comment'], chair_3_rating=self.params1['chair_3_rating'], chair_4_name=self.params1['chair_4_name'], chair_4_comment=self.params1['chair_4_comment'], chair_4_rating=self.params1['chair_4_rating'], chair_5_name=self.params1['chair_5_name'], chair_5_comment=self.params1['chair_5_comment'], chair_5_rating=self.params1['chair_5_rating'], chair_6_name=self.params1['chair_6_name'], chair_6_comment=self.params1['chair_6_comment'], chair_6_rating=self.params1['chair_6_rating'], chair_7_name=self.params1['chair_7_name'], chair_7_comment=self.params1['chair_7_comment'], chair_7_rating=self.params1['chair_7_rating'], chair_8_name=self.params1['chair_8_name'], chair_8_comment=self.params1['chair_8_comment'], chair_8_rating=self.params1['chair_8_rating'], chair_9_name=self.params1['chair_9_name'], chair_9_comment=self.params1['chair_9_comment'], chair_9_rating=self.params1['chair_9_rating'], chair_10_name=self.params1['chair_10_name'], chair_10_comment=self.params1['chair_10_comment'], chair_10_rating=self.params1['chair_10_rating']) self.feedback_2 = models.new_committee_feedback( committee=self.committee_2, comment=self.params2['comment'], rating=self.params2['rating'], chair_1_name=self.params2['chair_1_name'], chair_1_comment=self.params2['chair_1_comment'], chair_1_rating=self.params2['chair_1_rating'], chair_2_name=self.params2['chair_2_name'], chair_2_comment=self.params2['chair_2_comment'], chair_2_rating=self.params2['chair_2_rating'], chair_3_name=self.params2['chair_3_name'], chair_3_comment=self.params2['chair_3_comment'], chair_3_rating=self.params2['chair_3_rating'], chair_4_name=self.params2['chair_4_name'], chair_4_comment=self.params2['chair_4_comment'], chair_4_rating=self.params2['chair_4_rating'], chair_5_name=self.params2['chair_5_name'], chair_5_comment=self.params2['chair_5_comment'], chair_5_rating=self.params2['chair_5_rating'], chair_6_name=self.params2['chair_6_name'], chair_6_comment=self.params2['chair_6_comment'], chair_6_rating=self.params2['chair_6_rating'], chair_7_name=self.params2['chair_7_name'], chair_7_comment=self.params2['chair_7_comment'], chair_7_rating=self.params2['chair_7_rating'], chair_8_name=self.params2['chair_8_name'], chair_8_comment=self.params2['chair_8_comment'], chair_8_rating=self.params2['chair_8_rating'], chair_9_name=self.params2['chair_9_name'], chair_9_comment=self.params2['chair_9_comment'], chair_9_rating=self.params2['chair_9_rating'], chair_10_name=self.params2['chair_10_name'], chair_10_comment=self.params2['chair_10_comment'], chair_10_rating=self.params2['chair_10_rating']) self.assignment_1 = models.new_assignment(committee=self.committee_1)
def setUp(self): self.committee_1 = models.new_committee(name='DISC') self.committee_2 = models.new_committee(name='SOCHUM') self.params1 = { 'comment': "I never got called on ever. SAD!", 'rating': 4, 'chair_1_name': "Jake Tibbetts", 'chair_1_comment': "He was the head chair", 'chair_1_rating': 10, 'chair_2_name': "Trent", 'chair_2_comment': "He was the funny one", 'chair_2_rating': 3, 'chair_3_name': "Suchi", 'chair_3_comment': "She was the cute one", 'chair_3_rating': 8, 'chair_4_name': "Nikhil", 'chair_4_comment': "He was the baby", 'chair_4_rating': 1, 'chair_5_name': "", 'chair_5_comment': "", 'chair_5_rating': 0, 'chair_6_name': "", 'chair_6_comment': "", 'chair_6_rating': 0, 'chair_7_name': "", 'chair_7_comment': "", 'chair_7_rating': 0, 'chair_8_name': "", 'chair_8_comment': "", 'chair_8_rating': 0, 'chair_9_name': "", 'chair_9_comment': "", 'chair_9_rating': 0, 'chair_10_name': "", 'chair_10_comment': "", 'chair_10_rating': 0 } self.params2 = { 'comment': "Not Good", 'rating': 3, 'chair_1_name': "Jak Tibetts", 'chair_1_comment': "He was a literal chair", 'chair_1_rating': 8, 'chair_2_name': "Tent Gumberg", 'chair_2_comment': "He was the gummy one", 'chair_2_rating': 4, 'chair_3_name': "Suchi Luchi", 'chair_3_comment': "She was the muchi one", 'chair_3_rating': 6, 'chair_4_name': "Nikhil the pill", 'chair_4_comment': "He was the still just the baby", 'chair_4_rating': 2, 'chair_5_name': "", 'chair_5_comment': "", 'chair_5_rating': 0, 'chair_6_name': "", 'chair_6_comment': "", 'chair_6_rating': 0, 'chair_7_name': "", 'chair_7_comment': "", 'chair_7_rating': 0, 'chair_8_name': "", 'chair_8_comment': "", 'chair_8_rating': 0, 'chair_9_name': "", 'chair_9_comment': "", 'chair_9_rating': 0, 'chair_10_name': "", 'chair_10_comment': "", 'chair_10_rating': 0 } self.params3 = { 'comment': "Amazing", 'rating': 9, 'chair_1_name': "KT Lee", 'chair_1_comment': "Best Chair 5evr", 'chair_1_rating': 9, 'chair_2_name': "Gent Tumberg", 'chair_2_comment': "He was the jummy one", 'chair_2_rating': 5, 'chair_3_name': "Sita McLiar", 'chair_3_comment': "", 'chair_3_rating': 5, 'chair_4_name': "The Spirit of BMUN", 'chair_4_comment': "The Spirit of BMUN is ever strong", 'chair_4_rating': 3, 'chair_5_name': "Annalise!!!!", 'chair_5_comment': "She's the best!!!!", 'chair_5_rating': 9, 'chair_6_name': "", 'chair_6_comment': "", 'chair_6_rating': 0, 'chair_7_name': "", 'chair_7_comment': "", 'chair_7_rating': 0, 'chair_8_name': "", 'chair_8_comment': "", 'chair_8_rating': 0, 'chair_9_name': "", 'chair_9_comment': "", 'chair_9_rating': 0, 'chair_10_name': "", 'chair_10_comment': "", 'chair_10_rating': 0 } self.feedback_1 = models.new_committee_feedback( committee=self.committee_1, comment=self.params1['comment'], rating=self.params1['rating'], chair_1_name=self.params1['chair_1_name'], chair_1_comment=self.params1['chair_1_comment'], chair_1_rating=self.params1['chair_1_rating'], chair_2_name=self.params1['chair_2_name'], chair_2_comment=self.params1['chair_2_comment'], chair_2_rating=self.params1['chair_2_rating'], chair_3_name=self.params1['chair_3_name'], chair_3_comment=self.params1['chair_3_comment'], chair_3_rating=self.params1['chair_3_rating'], chair_4_name=self.params1['chair_4_name'], chair_4_comment=self.params1['chair_4_comment'], chair_4_rating=self.params1['chair_4_rating'], chair_5_name=self.params1['chair_5_name'], chair_5_comment=self.params1['chair_5_comment'], chair_5_rating=self.params1['chair_5_rating'], chair_6_name=self.params1['chair_6_name'], chair_6_comment=self.params1['chair_6_comment'], chair_6_rating=self.params1['chair_6_rating'], chair_7_name=self.params1['chair_7_name'], chair_7_comment=self.params1['chair_7_comment'], chair_7_rating=self.params1['chair_7_rating'], chair_8_name=self.params1['chair_8_name'], chair_8_comment=self.params1['chair_8_comment'], chair_8_rating=self.params1['chair_8_rating'], chair_9_name=self.params1['chair_9_name'], chair_9_comment=self.params1['chair_9_comment'], chair_9_rating=self.params1['chair_9_rating'], chair_10_name=self.params1['chair_10_name'], chair_10_comment=self.params1['chair_10_comment'], chair_10_rating=self.params1['chair_10_rating']) self.feedback_2 = models.new_committee_feedback( committee=self.committee_1, comment=self.params2['comment'], rating=self.params2['rating'], chair_1_name=self.params2['chair_1_name'], chair_1_comment=self.params2['chair_1_comment'], chair_1_rating=self.params2['chair_1_rating'], chair_2_name=self.params2['chair_2_name'], chair_2_comment=self.params2['chair_2_comment'], chair_2_rating=self.params2['chair_2_rating'], chair_3_name=self.params2['chair_3_name'], chair_3_comment=self.params2['chair_3_comment'], chair_3_rating=self.params2['chair_3_rating'], chair_4_name=self.params2['chair_4_name'], chair_4_comment=self.params2['chair_4_comment'], chair_4_rating=self.params2['chair_4_rating'], chair_5_name=self.params2['chair_5_name'], chair_5_comment=self.params2['chair_5_comment'], chair_5_rating=self.params2['chair_5_rating'], chair_6_name=self.params2['chair_6_name'], chair_6_comment=self.params2['chair_6_comment'], chair_6_rating=self.params2['chair_6_rating'], chair_7_name=self.params2['chair_7_name'], chair_7_comment=self.params2['chair_7_comment'], chair_7_rating=self.params2['chair_7_rating'], chair_8_name=self.params2['chair_8_name'], chair_8_comment=self.params2['chair_8_comment'], chair_8_rating=self.params2['chair_8_rating'], chair_9_name=self.params2['chair_9_name'], chair_9_comment=self.params2['chair_9_comment'], chair_9_rating=self.params2['chair_9_rating'], chair_10_name=self.params2['chair_10_name'], chair_10_comment=self.params2['chair_10_comment'], chair_10_rating=self.params2['chair_10_rating']) self.feedback_3 = models.new_committee_feedback( committee=self.committee_2, comment=self.params3['comment'], rating=self.params3['rating'], chair_1_name=self.params3['chair_1_name'], chair_1_comment=self.params3['chair_1_comment'], chair_1_rating=self.params3['chair_1_rating'], chair_2_name=self.params3['chair_2_name'], chair_2_comment=self.params3['chair_2_comment'], chair_2_rating=self.params3['chair_2_rating'], chair_3_name=self.params3['chair_3_name'], chair_3_comment=self.params3['chair_3_comment'], chair_3_rating=self.params3['chair_3_rating'], chair_4_name=self.params3['chair_4_name'], chair_4_comment=self.params3['chair_4_comment'], chair_4_rating=self.params3['chair_4_rating'], chair_5_name=self.params3['chair_5_name'], chair_5_comment=self.params3['chair_5_comment'], chair_5_rating=self.params3['chair_5_rating'], chair_6_name=self.params3['chair_6_name'], chair_6_comment=self.params3['chair_6_comment'], chair_6_rating=self.params3['chair_6_rating'], chair_7_name=self.params3['chair_7_name'], chair_7_comment=self.params3['chair_7_comment'], chair_7_rating=self.params3['chair_7_rating'], chair_8_name=self.params3['chair_8_name'], chair_8_comment=self.params3['chair_8_comment'], chair_8_rating=self.params3['chair_8_rating'], chair_9_name=self.params3['chair_9_name'], chair_9_comment=self.params3['chair_9_comment'], chair_9_rating=self.params3['chair_9_rating'], chair_10_name=self.params3['chair_10_name'], chair_10_comment=self.params3['chair_10_comment'], chair_10_rating=self.params3['chair_10_rating']) self.assignment_1 = models.new_assignment(committee=self.committee_1)
def get_test_object(cls): return models.new_committee()
def test_chair(self): chair1 = models.new_user(user_type=User.TYPE_CHAIR) self.as_user(chair1).do_test() c = models.new_committee(rubric_id=self.object.id) chair2 = models.new_user(user_type=User.TYPE_CHAIR, committee=c) self.as_user(chair2).do_test()