mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.10.x] Fixed #27637 -- Fixed timesince, timeuntil in leap year edge case.
Backport of 3e5c5e6754 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							1c9f49e80f
						
					
				
				
					commit
					25e8222615
				
			| @@ -105,6 +105,11 @@ class TimesinceTests(unittest.TestCase): | ||||
|         self.assertEqual(timeuntil(today - self.oneday, today), '0\xa0minutes') | ||||
|         self.assertEqual(timeuntil(today + self.oneweek, today), '1\xa0week') | ||||
|  | ||||
|     def test_leap_year(self): | ||||
|         start_date = datetime.date(2016, 12, 25) | ||||
|         self.assertEqual(timeuntil(start_date + self.oneweek, start_date), '1\xa0week') | ||||
|         self.assertEqual(timesince(start_date, start_date + self.oneweek), '1\xa0week') | ||||
|  | ||||
|     def test_naive_datetime_with_tzinfo_attribute(self): | ||||
|         class naive(datetime.tzinfo): | ||||
|             def utcoffset(self, dt): | ||||
| @@ -117,3 +122,4 @@ class TimesinceTests(unittest.TestCase): | ||||
|     def test_thousand_years_ago(self): | ||||
|         t = datetime.datetime(1007, 8, 14, 13, 46, 0) | ||||
|         self.assertEqual(timesince(t, self.t), '1000\xa0years') | ||||
|         self.assertEqual(timeuntil(self.t, t), '1000\xa0years') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user