Пример #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()
Пример #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()
Пример #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
Пример #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
Пример #5
0
 def setUp(self):
     for user in AppUser.all(): user.delete()
     for profile in Profile.all(): profile.delete()
Пример #6
0
 def setUp(self):
     for user in AppUser.all(): user.delete()
     for profile in Profile.all(): profile.delete()