Django

Code

Changeset 2449

Show
Ignore:
Timestamp:
02/28/06 21:12:24 (3 years ago)
Author:
adrian
Message:

Added model unit tests for get_DATEFIELD_list(). Refs #1423

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/testapp/models/lookup.py

    r1834 r2449  
    128128Article 1 
    129129 
     130# Every DateField and DateTimeField give their model module a get_FOO_list 
     131# function. 
     132>>> articles.get_pub_date_list('year') 
     133[datetime.datetime(2005, 1, 1, 0, 0)] 
     134>>> articles.get_pub_date_list('month') 
     135[datetime.datetime(2005, 7, 1, 0, 0), datetime.datetime(2005, 8, 1, 0, 0)] 
     136>>> articles.get_pub_date_list('day') 
     137[datetime.datetime(2005, 7, 26, 0, 0), datetime.datetime(2005, 7, 27, 0, 0), datetime.datetime(2005, 7, 28, 0, 0), datetime.datetime(2005, 8, 1, 0, 0)] 
     138 
    130139# Underscores and percent signs have special meaning in the underlying 
    131140# database library, but Django handles the quoting of them automatically.