joke2k / django-faker

Django-faker uses fake-factory to generate test data for Django models and templates
MIT License
245 stars 48 forks source link

AttributeError: 'Generator' object has no attribute 'phoneNumber' #12

Open show0k opened 10 years ago

show0k commented 10 years ago

I've a custom User model with a field phone_number = models.CharField( max_length=20)

Traceback (most recent call last): File "", line 1, in File "/dev/local/lib/python2.7/site-packages/django_faker/populator.py", line 163, in execute insertedEntities[klass].append( self.entities[klass].execute(using, insertedEntities) ) File "/dev/local/lib/python2.7/site-packages/django_faker/populator.py", line 104, in execute value = format(insertedEntities) if hasattr(format,'call') else format File "/dev/local/lib/python2.7/site-packages/django_faker/guessers.py", line 25, in if name in ('phone_number','phonenumber','phone'): return lambda x:generator.phoneNumber() AttributeError: 'Generator' object has no attribute 'phoneNumber'

Brobin commented 9 years ago

Issue with faker's API changing. It should be return lambda x: generator.phone_number(). I'm making some fixed on my fork if you're interested.