Closed andrkhr closed 4 years ago
Oh, there is a name conflict with the lesson parameter. I think it is better to rename to _lesson or ddf_lesson
I will fix that and create a new release for you.
Thanks for creating the issue!
Oh thanks! But here the problem is something else. I tried to rename the variables, but I get exactly the same problem.
Here is how I did it:
# test.py
def test_create_course_lesson():
ddf_course = G(Course)
ddf_lesson = G(Lesson)
lesson_course = G(CourseLesson, course=ddf_course, lesson=ddf_lesson)
assert lesson_course.id is not None
@hauworkarea
It should be: lesson_course = G(CourseLesson, course=ddf_course, ddf_lesson=ddf_lesson)
This PR fixes that: https://github.com/paulocheque/django-dynamic-fixture/pull/117
Thanks again for reporting!
Tests fall when trying to create objects with a primary key. Sample Models and Test
I get an error
django 3.0.2 django-dynamic-fixture 3.0.1 pytest 5.3.2 pytest-django 3.7.0
On version django-dynamic-fixture 2.0.0 everything works fine