Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
 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)
Exemple #5
0
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()
Exemple #6
0
    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'])
Exemple #7
0
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()