Exemplo n.º 1
0
def new_hunt(owner,duration,save=True):
    hunt = Hunt()
    hunt.owner = owner
    (hunt.phrase,hunt.tag) = phrase.new_phrase()
    hunt.start_time = datetime.utcnow()
    hunt.end_time = hunt.start_time + duration
    hunt.vote_end_time = hunt.end_time + timedelta(days=1)
    if save:
        hunt.save()
    return hunt
Exemplo n.º 2
0
 def test_new_phrase(self):
     new = phrase.new_phrase()
     self.assert_(new)
     self.assertEquals(len(new),2)