summaryrefslogtreecommitdiff
path: root/docs/fuzzy.rst
diff options
context:
space:
mode:
authorSaul Shanabrook <s.shanabrook@gmail.com>2013-04-16 10:49:31 -0300
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-04-21 19:38:29 +0200
commitb6ecfdf7b8f0b05b3e78fe3aafaf26d9c00c3259 (patch)
treee2b212ba77490b55fe6dc04ebc3f171b4d7ecc45 /docs/fuzzy.rst
parent876845102c4a217496d0f6435bfe1e3726d31fe4 (diff)
downloadfactory-boy-b6ecfdf7b8f0b05b3e78fe3aafaf26d9c00c3259.tar
factory-boy-b6ecfdf7b8f0b05b3e78fe3aafaf26d9c00c3259.tar.gz
Add FuzzyDate
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'docs/fuzzy.rst')
-rw-r--r--docs/fuzzy.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/fuzzy.rst b/docs/fuzzy.rst
index f1f4085..7d56995 100644
--- a/docs/fuzzy.rst
+++ b/docs/fuzzy.rst
@@ -70,6 +70,33 @@ FuzzyInteger
int, the inclusive higher bound of generated integers
+FuzzyDate
+---------
+
+.. class:: FuzzyDate(start_date[, end_date])
+
+ The :class:`FuzzyDate` fuzzer generates random dates within a given
+ inclusive range.
+
+ The :attr:`end_date` bound may be omitted, in which case it defaults to the current date:
+
+ .. code-block:: pycon
+
+ >>> fd = FuzzyDate(datetime.date(2008, 1, 1))
+ >>> fd.start_date, fd.end_date
+ datetime.date(2008, 1, 1), datetime.date(2013, 4, 16)
+
+ .. attribute:: start_date
+
+ :class:`datetime.date`, the inclusive lower bound of generated dates
+
+ .. attribute:: end_date
+
+ :class:`datetime.date`, the inclusive higher bound of generated dates
+
+ int, the inclusive higher bound of generated dates
+
+
Custom fuzzy fields
-------------------