Example #1
0
    def post(self):
        template_values = {
            'first_name': self.request.get('first_name'),
            'second_name': self.request.get('second_name'),
            'ghost_names': GhostrEngine.list_random_three(),
        }

        path = os.path.join(os.path.dirname(__file__),
                            'templates/selection.html')
        self.response.out.write(template.render(path, template_values))
Example #2
0
    def testListRandomThree(self):
        user = users.User("*****@*****.**")

        ghost_one = Ghost(ghost_name="Tom", gmail=user)
        ghost_two = Ghost(ghost_name="Dick")
        ghost_three = Ghost(ghost_name="Harry")

        ndb.put_multi([ghost_one, ghost_two, ghost_three])

        available_ghosts = GhostrEngine.list_random_three()

        assert "Harry" in available_ghosts
        assert "Dick" in available_ghosts
        assert "Tom" not in available_ghosts