python-betterproto icon indicating copy to clipboard operation
python-betterproto copied to clipboard

_get_field_default_gen does not return the correct generator when freezegun is in use

Open markallanson opened this issue 3 years ago • 2 comments

The function _get_field_default_gen checks if a field's type is a datetime using t is datetime, which means if freezegun is being used in a test it generates the wrong default generator function.

Suggest this changes to t instanceof datetime to support cases like this.

markallanson avatar Jul 22 '22 16:07 markallanson

Fair enough, would you be willing to open a pull request to fix this?

Gobot1234 avatar Jul 22 '22 16:07 Gobot1234

Yes! I am just heading out of the office on vacation and wanted to make sure I left at least a tombstone to create an PR for next week!

markallanson avatar Jul 22 '22 16:07 markallanson