def setUp(self): d = Domain(domain="http://www.test.com") d.save() s = Shurl(url="http://www.test.com", domain=d) s.save() s.assign_short_suffix() m = MonthLog(domain=d) m.save() past_time = datetime.date(2012, 3, 14) old_m = MonthLog(domain=d, creation_date=past_time, month=first_of_the_month(past_time)) old_m.save()
def setUp(self): d = Domain(domain="http://www.test.com") d.save() s = Shurl(url="http://www.test.com/a/b/c/", domain=d) s.save() s.assign_short_suffix() t = Shurl(url="http://www.test.com/another_dir/", domain=d) t.save() t.assign_short_suffix() s.get_url() t.get_url() t.get_url()
def setUp(self): d = Domain(domain="http://www.test.com") d.save() s = Shurl(url="http://www.test.com/stuff/", domain=d) s.save() s.assign_short_suffix() # populate database with a lot of shurls i = 0 while i < 66: url = "http://www.test.com/" + str(i) + "/" a = Shurl(url=url, domain=d) a.save() a.assign_short_suffix() i += 1