12.8.5. crate_anon.testing.providers
crate_anon/testing/providers.py
Copyright (C) 2015, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
CRATE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with CRATE. If not, see <https://www.gnu.org/licenses/>.
Faker test data providers.
There may be some interest in a Faker Medical community provider if we felt it was worth the effort.
https://github.com/joke2k/faker/issues/1142
- class crate_anon.testing.providers.ConsistentDateOfBirthProvider(generator: Any)[source]
Returns a date of birth no greater than 1st January 2000. All patient notes are created after this date.
Faker date_of_birth calculates from the current time so gives different results on different days. In our case we don’t want the date of birth to be greater than the date stamp on the note.
- class crate_anon.testing.providers.DateFormatProvider(generator: Any)[source]
Return a random date format.
- class crate_anon.testing.providers.ForenameProvider(generator: Any)[source]
Return a forename given the sex of the person
- class crate_anon.testing.providers.FormattedDateOfBirthProvider(generator: Any)[source]
Return a random date of birth in a random format
- class crate_anon.testing.providers.FormattedIncrementingDateProvider(generator: Any)[source]
Returns an incrementing date in a random format.