#NEWLINE# def test_objects_dates( self ) : #NEWLINE# #INDENT# d2011 = datetime . date ( year = 2011 , month = 1 , day = 1 ) #NEWLINE# self . assertEqual ( len ( Date . objects . language ( 'en' ) . dates ( 'shared_date' , 'year' ) ) , 2 ) #NEWLINE# self . assertEqual ( len ( Date . objects . language ( 'en' ) . dates ( 'shared_date' , 'year' ) . all ( ) ) , 2 ) #NEWLINE# self . assertEqual ( len ( Date . objects . language ( 'en' ) . dates ( 'shared_date' , 'month' ) ) , 3 ) #NEWLINE# self . assertEqual ( len ( Date . objects . language ( 'en' ) . dates ( 'shared_date' , 'day' ) ) , 3 ) #NEWLINE# self . assertEqual ( len ( Date . objects . language ( 'en' ) . dates ( 'shared_date' , 'day' ) . filter ( shared_date__gt = d2011 ) ) , 2 )