diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2013-10-04 10:52:26 -0700 |
---|---|---|
committer | Raphaƫl Barrois <raphael.barrois@polytechnique.org> | 2013-10-29 00:19:46 +0100 |
commit | 990bfaf44ce39aaa01a2107aadc1933947bcf550 (patch) | |
tree | 65ed6af3a74f781ab02b088752dccf313514fae7 /docs | |
parent | 6834fd72331f186a1f1fe793e193b3cfba36d5b7 (diff) | |
download | factory-boy-990bfaf44ce39aaa01a2107aadc1933947bcf550.tar factory-boy-990bfaf44ce39aaa01a2107aadc1933947bcf550.tar.gz |
Added FuzzyText attribute.
Useful for unique model attributes where the specific value can be fuzzy.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/fuzzy.rst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/fuzzy.rst b/docs/fuzzy.rst index d88cb5a..582a654 100644 --- a/docs/fuzzy.rst +++ b/docs/fuzzy.rst @@ -24,6 +24,35 @@ FuzzyAttribute The callable that generates random values +FuzzyText +--------- + + +.. class:: FuzzyText(length=12, chars=string.ascii_letters, prefix='') + + The :class:`FuzzyText` fuzzer yields random strings beginning with + the given :attr:`prefix`, followed by :attr:`length` charactes chosen + from the :attr:`chars` character set, + and ending with the given :attr:`suffix`. + + .. attribute:: length + + int, the length of the random part + + .. attribute:: prefix + + text, an optional prefix to prepend to the random part + + .. attribute:: suffix + + text, an optional suffix to append to the random part + + .. attribute:: chars + + char iterable, the chars to choose from; defaults to the list of ascii + letters and numbers. + + FuzzyChoice ----------- |