def test_creating_person_from_factory_using_paramters(self): person_baker_ = baker.Baker(models.Person) person = person_baker_.make(happy=False, age=20, gender="M", name="John") assert person.age == 20 assert person.happy is False assert person.name == "John" assert person.gender == "M"
def test_raise_model_not_found(self): with pytest.raises(ModelNotFound): baker.Baker("non_existing.Model") with pytest.raises(ModelNotFound): baker.Baker("NonExistingModel")