Esempio n. 1
0
 def test_add_user(self):
     user = AppUser(user=User(email="*****@*****.**"),
                    username="******",
                    email="*****@*****.**",
                    is_staff=True).save()
     assert not Profile.all().count()
     profile = get_profile(user)
     assert profile.notification == 5
     assert Profile.all().count()
Esempio n. 2
0
 def test_add_user(self):
     user = AppUser(user=User(email="*****@*****.**"),
                    username="******",
                    email="*****@*****.**",
                    is_staff=True).save()
     assert not Profile.all().count()
     profile = get_profile(user)
     assert profile.notification == 5
     assert Profile.all().count()
Esempio n. 3
0
def get_profile(user):
    try:
        return Profile.all().filter("user = ", user)[0]
    except IndexError:
        profile = Profile(user=user, notification=5)
        profile.save()
        return profile
Esempio n. 4
0
def get_profile(user):
    try:
        return Profile.all().filter("user = ", user)[0]
    except IndexError:
        profile = Profile(user=user, notification=5)
        profile.save()
        return profile
Esempio n. 5
0
 def setUp(self):
     for user in AppUser.all(): user.delete()
     for profile in Profile.all(): profile.delete()
Esempio n. 6
0
 def setUp(self):
     for user in AppUser.all(): user.delete()
     for profile in Profile.all(): profile.delete()