def test_default_value_no_docs_assessed(self): user = User(username='******', email='*****@*****.**') user.set_password('test') user.save() userProfile = UserProfile(user=user) userProfile.save() self.assertEqual(userProfile.no_docs_assessed == 0, True)
def test_default_value_total_tokens(self): user = User(username='******', email='*****@*****.**') user.set_password('test') user.save() userProfile = UserProfile(user=user) userProfile.save() self.assertEqual(userProfile.total_tokens == 0, True)
def test_userProfile_creation(self): user = User(username='******', email='*****@*****.**') user.set_password('test') user.save() userProfile = UserProfile(user=user) userProfile.save() self.assertIsNotNone(self, userProfile)
def test_maxHighScore(self): user = User(username='******', email='*****@*****.**') user.set_password('test') user.save() userProfile = UserProfile(user=user) userProfile.save() ge = GameExperiment() ge.save() mhs = MaxHighScore(user=user, game_experiment=ge) self.assertIsNotNone(self, mhs)
def add_player(name, pw): email = '{0}@{1}.com'.format(name,name) try: u = User.objects.get(username=name) except: u = User(username=name, email=email) u.set_password(pw) u.save() up = UserProfile(user=u) up.save()
def test_pick_view_with_new_user(self): user = User(username='******', email='*****@*****.**') user.set_password('test') user.save() userProfile = UserProfile(user=user) userProfile.save() response = self.client.get(reverse('pick', kwargs={'username': user})) self.assertEqual(response.status_code, 200) self.assertQuerysetEqual(response.context['lock'], ['0', '1', '1', '1', '1', '1'])