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()
def get_profile(user): try: return Profile.all().filter("user = ", user)[0] except IndexError: profile = Profile(user=user, notification=5) profile.save() return profile
def setUp(self): for user in AppUser.all(): user.delete() for profile in Profile.all(): profile.delete()