@@ -157,8 +157,12 @@ def test_diff_for_humans_now_and_nearly_future_month(self):
157157 self .assertEqual ('3 weeks from now' , Date .today ().add (weeks = 3 ).diff_for_humans ())
158158
159159 def test_diff_for_humans_now_and_future_month (self ):
160- self .assertEqual ('4 weeks from now' , Date .today ().add (weeks = 4 ).diff_for_humans ())
161- self .assertEqual ('1 month from now' , Date .today ().add (months = 1 ).diff_for_humans ())
160+ with self .wrap_with_test_now (Pendulum .create (2016 , 3 , 1 )):
161+ self .assertEqual ('4 weeks from now' , Date .today ().add (weeks = 4 ).diff_for_humans ())
162+ self .assertEqual ('1 month from now' , Date .today ().add (months = 1 ).diff_for_humans ())
163+
164+ with self .wrap_with_test_now (Pendulum .create (2017 , 1 , 31 )):
165+ self .assertEqual ('1 month from now' , Date .today ().add (weeks = 4 ).diff_for_humans ())
162166
163167 def test_diff_for_humans_now_and_future_months (self ):
164168 self .assertEqual ('2 months from now' , Date .today ().add (months = 2 ).diff_for_humans ())
@@ -191,8 +195,12 @@ def test_diff_for_humans_other_and_nearly_month(self):
191195 self .assertEqual ('3 weeks before' , Date .today ().diff_for_humans (Date .today ().add (weeks = 3 )))
192196
193197 def test_diff_for_humans_other_and_month (self ):
194- self .assertEqual ('4 weeks before' , Date .today ().diff_for_humans (Date .today ().add (weeks = 4 )))
195- self .assertEqual ('1 month before' , Date .today ().diff_for_humans (Date .today ().add (months = 1 )))
198+ with self .wrap_with_test_now (Pendulum .create (2016 , 3 , 1 )):
199+ self .assertEqual ('4 weeks before' , Date .today ().diff_for_humans (Date .today ().add (weeks = 4 )))
200+ self .assertEqual ('1 month before' , Date .today ().diff_for_humans (Date .today ().add (months = 1 )))
201+
202+ with self .wrap_with_test_now (Pendulum .create (2017 , 1 , 31 )):
203+ self .assertEqual ('1 month before' , Date .today ().diff_for_humans (Date .today ().add (weeks = 4 )))
196204
197205 def test_diff_for_humans_other_and_months (self ):
198206 self .assertEqual ('2 months before' , Date .today ().diff_for_humans (Date .today ().add (months = 2 )))
0 commit comments