Ejemplo n.º 1
0
def createMicropost(content):
    micropost = MicroPost()
    micropost.author = UserManager.getUser().name
    micropost.authorKey = UserManager.getUser().key
    micropost.content = content
    micropost.isMine = True
    micropost.save()
    return micropost
Ejemplo n.º 2
0
def given_there_are_3_posts_of_and_3_posts_of_my_contacts(
        step, nbposts, nbcontactposts):
    nbposts = int(nbposts)
    nbcontactposts = int(nbcontactposts)

    for i in range(1, nbposts + 1):
        micropost = MicroPost()
        micropost.author = UserManager.getUser().name
        micropost.authorKey = UserManager.getUser().key
        micropost.content = "my content {}".format(i)
        micropost.date = datetime.datetime(2011, i, 01, 11, 05, 12)
        micropost.isMine = True
        micropost.save()

    for i in range(1, nbcontactposts + 1):
        micropost = MicroPost()
        micropost.author = world.user2.name
        micropost.authorKey = world.user2.key
        micropost.content = "contact content {}".format(i)
        micropost.date = datetime.datetime(2011, i, 10, 11, 05, 12)
        micropost.isMine = False
        micropost.save()
Ejemplo n.º 3
0
def given_there_are_3_posts_of_and_3_posts_of_my_contacts(step,
                                                          nbposts,
                                                          nbcontactposts):
    nbposts = int(nbposts)
    nbcontactposts = int(nbcontactposts)

    for i in range(1, nbposts + 1):
        micropost = MicroPost()
        micropost.author = UserManager.getUser().name
        micropost.authorKey = UserManager.getUser().key
        micropost.content = "my content {}".format(i)
        micropost.date = datetime.datetime(2011, i, 01, 11, 05, 12)
        micropost.isMine = True
        micropost.save()

    for i in range(1, nbcontactposts + 1):
        micropost = MicroPost()
        micropost.author = world.user2.name
        micropost.authorKey = world.user2.key
        micropost.content = "contact content {}".format(i)
        micropost.date = datetime.datetime(2011, i, 10, 11, 05, 12)
        micropost.isMine = False
        micropost.save()