question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There is no available initial state for the content type while testing

See original GitHub issue

When I create an integration test, I create objects in the DB for which I have defined a state field.

        p = Procedure.objects.create()

In django admin I defined 4 states, and 3 transitions

Screenshot 2019-05-12 at 17 46 39

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:

raise RiverException(ErrorCode.NO_AVAILABLE_INITIAL_STATE, 'There is no available initial state for the content type %s. ' % self._content_type)
river.utils.exceptions.RiverException: There is no available initial state for the content type procedure. 

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
superandrewcommented, May 13, 2019

thanks! however setting the field fixed the error, so all tests now run

0reactions
javrasyacommented, Jul 2, 2019

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.

https://github.com/javrasya/django-river/issues/77

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bad state: Cannot set the body fields of a Request with content ...
If it's a String, it's encoded using [encoding] and used as the body of the request. The content-type of the request will default...
Read more >
Streaming in an Arduino Sketch - Initial State
Github repo and detailed documentation can be found here: https://github.com/InitialState/arduino_streamers Each of the following example...
Read more >
Testing - Django REST framework
REST framework includes a few helper classes that extend Django's existing test framework, and improve support for making API requests.
Read more >
Testing REST Endpoints Using REST Assured - Semaphore CI
In this tutorial, we will deal with functional tests that do not ... There are many Java libraries that allow us to write...
Read more >
ActivityScenario | Android Developers
ActivityScenario provides APIs to start and drive an Activity's lifecycle state for testing. It works with arbitrary activities and works ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found