def setUp(self): super(TestUser, self).setUp() self.store = FakeStore() with mock.patch("uuid.uuid4") as mock_uuid: mock_uuid.return_value.hex = "tokenvalue" self.user = User.use(self.store)( name="Foo Bar", email="*****@*****.**", password="******")
def setUp(self): super(TestVotes, self).setUp() self.store = FakeStore() self.user = self.store.create( User, name="Foo Bar", email="*****@*****.**", password="******") self.votes = self.store.create( Votes, email=self.user.email, contest=config.CONTEST_ID) self.categories = CATEGORIES.contest(config.CONTEST_ID) category = self.categories[0] self.votes.add_vote(category.key, category.nominees[0].key) category = self.categories[1] self.votes.add_vote(category.key, category.nominees[1].key)
def setUp(self): super(TestWinner, self).setUp() self.store = FakeStore() self.user = self.store.create(User, name="Foo Bar", email="*****@*****.**", password="******") self.categories = CATEGORIES.contest(config.CONTEST_ID) self.winner = self.store.create(Winner, contest=config.CONTEST_ID) self.winner.add_winner(self.categories[0].key, self.categories[0].nominees[0].key) self.winner.add_winner(self.categories[1].key, self.categories[1].nominees[1].key)