コード例 #1
0
 def mock(cls, **kwargs):
     data = {
         'name': kwargs.pop('name', 'Test'),
         'year_established': kwargs.pop('year_established', 10),
         'is_profitable': kwargs.pop('is_profitable', True)
     }
     model = cls(**data)
     save(model)
     return model
コード例 #2
0
 def mock(cls, **kwargs):
     data = {
         'name': kwargs.pop('name', 'Test'),
         'months_of_service': kwargs.pop('months_of_service', 10),
         'is_manager': kwargs.pop('is_manager', True),
         'person_id': kwargs.pop('person_id', None)
     }
     model = cls(**data)
     save(model)
     return model
コード例 #3
0
 def mock(cls, **kwargs):
     data = {
         'name': kwargs.pop('name', 'Test'),
         'age': kwargs.pop('age', 10),
         'is_employed': kwargs.pop('is_employed', True),
         'companies': kwargs.pop('companies', []),
         'gender': kwargs.pop('gender', 'male'),
         'rate': kwargs.pop('rate', '1.00')
     }
     model = cls(**data)
     save(model)
     return model