level12 / keg-elements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improvements for random int/numeric generation

rsyring opened this issue · comments

I think MethodsMixin.testing_create() could be improved as follows:

  • detect numeric column precision and/or Small/Normal/Big int columns and set random range accordingly
  • read numeric range form the column's info:
# gives -100 to 100
db.Column(db.Integer, info={"random_magnitude": 100})

# gives -50 to 100
db.Column(db.Integer, info={"random_range": (-50, 100)})