-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is no available initial state for the content type while testing #74
Comments
I notice that in my River applications I have just
|
this is what I tried, after understanding that many of the tutorials refer to old version of the framework:
In a non testing scenario I suppose that you should run migrate, or maybe there is something that I am still missing. My test suite starts with:
then, for every test in which I try to create programmatically a
|
ok, I was able to fix it. The problem was that (as a fool) I was doing the setup in the setup method, so every case didn't have data. So Now it works, passing the first state to the object I create
then,
however, I still have this: |
When in functional test I
In normal mode I have no errors, apart from the continuous |
Hi @superandrew, it seems like you are not setting But apart from that, I can say that the warnings and error messages should definitely be improved with the field_name part as well. |
oh, wow. Silly me. It works now. What do you think about the
Thanks! |
There seems to be something wrong with field_name error message though. I will take a look at this when I have time. But you try setting your field_name in the TransitionApprovalMeta. It should fix it. Here is an example of creating it programmatically. It is with https://github.com/javrasya/django-river/blob/master/river/tests/base_test.py |
thanks! however setting the field fixed the error, so all tests now run |
@javrasya I think there still is a problem with the fields because every time I run django I have this message:
and everytime I run
Do you think this is related to this issue or do you think a new one should be created? Thanks |
@superandrew , I think I know why this is happening and it is a bug in the place where this is logged. It is not affecting anything. Just logging part is buggy. Please ignore it until I fix and release it. https://github.com/javrasya/django-river/blob/master/river/apps.py#L21
|
I created a PR @superandrew . I am waiting for the build to see if that breaks anything |
I even published it. Can you try |
thanks @javrasya ! I think the problem has been solved partially, but not completely.
What happens is, despite not being warned, a new migration is generated every time I run Is this normal? Thanks |
It doesn't seem to be normal 😄 Can you share those migration file contents? So I can have some idea maybe 🤔 |
I managed to reproduce that. I will have a look if I can understand why this is happening. |
Here I created another issue for that. Let's discuss it over there. Please don't use this issue. If you have another issue feel free to create a new one for it. |
When I create an integration test, I create objects in the DB for which I have defined a state field.
In django admin I defined 4 states, and 3 transitions
So I understood from the documentation that since CREATED is never a destination state, django-river would have guessed that this was the initial state.
But I get this error:
I'm completely lost, as I understand that this is common but I haven't find a solution, also looking at similar issues.
Any idea?
Thanks
The text was updated successfully, but these errors were encountered: