def test_pretty_timestamp(self):
     my_time = pytz.utc.localize(datetime.utcfromtimestamp(1478187004))  # Thu, 03 Nov 2016 15:30:04 GMT
     self.assertEquals('20 hours ago', pretty_date(my_time, now=datetime(2016, 11, 04, 12, 0, 0, 0, pytz.UTC)))
     self.assertEquals('Yesterday', pretty_date(my_time, now=datetime(2016, 11, 05, 12, 0, 0, 0, pytz.UTC)))
     self.assertEquals('2 days ago', pretty_date(my_time, now=datetime(2016, 11, 06, 12, 0, 0, 0, pytz.UTC)))
     self.assertEquals('1 week(s) ago', pretty_date(my_time, now=datetime(2016, 11, 11, 12, 0, 0, 0, pytz.UTC)))
     self.assertEquals('1 month(s) ago', pretty_date(my_time, now=datetime(2016, 12, 11, 12, 0, 0, 0, pytz.UTC)))
     self.assertEquals('1 year(s) ago', pretty_date(my_time, now=datetime(2017, 11, 11, 12, 0, 0, 0, pytz.UTC)))
 def __init__(self, change_time, repo_slug, repo_name, project_name,
              project_key, project_url, ref_id, display_id):
     self.change_time = change_time
     self.repo_name = repo_name
     self.project_name = project_name
     self.project_key = project_key
     self.branch = display_id
     self.link = '{}/repos/{}/pull-requests?create&sourceBranch={}'.format(project_url, repo_slug, ref_id)
     self.title = pretty_date(datetime.fromtimestamp(change_time / 1000))