paulocheque / django-dynamic-fixture

A complete library to create dynamic model instances for testing purposes.
http://django-dynamic-fixture.readthedocs.io/
Other
390 stars 67 forks source link

Unusually named primary key fields don't work. #32

Closed ghost closed 5 years ago

ghost commented 11 years ago
class SampleModel(models.Model):
    sample_model_id = models.AutoField(primary_key=True)
    some_data = models.TextField()

...

def some_function():
    s = G(SampleModel, sample_model_id=1234, some_data='abcd')
    assert s.sample_model_id == 1
    assert s.some_data == 'abcd'

I have the above model, and when I run some_function the assert statements pass.

paulocheque commented 11 years ago

Thanks for reporting! bug! If you have a pull request for this I will accept! Otherwise, I will fix it as soon as I can.

ghost commented 11 years ago

I accidentally closed the issue, then reopened it. I am not too familiar with the github interface.

I will look into fixing this bug myself when I have time. Guess we'll see who gets to it first?

Thanks for your reply and acknowledgement of the bug.