def test_Vote_read(self): """ Tests Vote model read """ my_model = VoteF.create(choice='n') self.assertTrue(my_model.choice == 'n')
def test_vote_delete(self): """Tests Vote model delete.""" model = VoteF.create() model.delete() # check if deleted self.assertTrue(model.pk is None)
def test_vote_create(self): """Tests Vote model creation.""" model = VoteF.create() # check if PK exists self.assertTrue(model.pk is not None) # check if we have a user self.assertTrue(model.user is not None)
def setUp(self): """ Setup before each test """ logging.disable(logging.CRITICAL) self.user = UserF.create(**{"username": "******", "password": "******", "is_staff": True}) self.project = ProjectF.create() self.committee = CommitteeF.create(project=self.project, users=[self.user]) self.ballot = BallotF.create(committee=self.committee) self.vote = VoteF.create(ballot=self.ballot)
def test_vote_update(self): """Tests Vote model update.""" model = VoteF.create() new_model_data = {'choice': 'y'} model.__dict__.update(new_model_data) model.save() # check if updated for key, val in new_model_data.items(): self.assertEqual(model.__dict__.get(key), val)
def test_vote_update(self): """Tests Vote model update.""" model = VoteF.create() new_model_data = { 'choice': 'y' } model.__dict__.update(new_model_data) model.save() # check if updated for key, val in new_model_data.items(): self.assertEqual(model.__dict__.get(key), val)
def setUp(self): """ Setup before each test """ logging.disable(logging.CRITICAL) self.user = UserF.create(**{ 'username': '******', 'password': '******', 'is_staff': True }) self.project = ProjectF.create() self.committee = CommitteeF.create(project=self.project, users=[self.user]) self.ballot = BallotF.create(committee=self.committee) self.vote = VoteF.create(ballot=self.ballot)
def setUp(self): """ Setup before each test """ logging.disable(logging.CRITICAL) self.my_user = UserF.create(**{ 'username': '******', 'password': '******', 'is_staff': True }) self.my_project = ProjectF.create() self.my_committee = CommitteeF.create(project=self.my_project, users=[self.my_user]) self.my_ballot = BallotF.create(committee=self.my_committee) self.my_vote = VoteF.create(ballot=self.my_ballot)
def test_vote_read(self): """Tests Vote model read.""" model = VoteF.create(choice='n') self.assertTrue(model.choice == 'n')