First time here? Check out the FAQ!
0

Django : dumpdata of database after tests with --keepdb

  • retag add tags

Hello I have a test script in my django project which creates some data in the test database. I launch the test using the green arrow and a launch configuration test --keepdb. The test terminates OK and displays 'Preserving testdatabase for alias default.'

Then I launch another configuration which contains the command dumpdata -o --database

The intention is to save the test database into a fixture so as to use it for other tests. I get the following error message :

CommandError: Unable to serialize database: The connection 'test_djangoLudd21' doesn't exist.

What am I doing wrong?

anonymous user
Anonymous
asked 2023-12-05 13:11:28 -0500
Wingware Support's avatar
4k
Wingware Support
updated 2023-12-07 08:18:46 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Does this work outside of Wing? If so, take a look at the different in os.environ in each case, in case something else needs to be set in Environment in Wing's Project Properties. I can't speak to whether you're using Django incorrectly since I don't have a lot of experience with it.

Wingware Support's avatar Wingware Support (2023-12-07 08:18:32 -0500) edit

Unfortunately I get the same behavoir outside of wing.

piscvau's avatar piscvau (2023-12-07 10:26:35 -0500) edit
add a comment see more comments

1 Answer

0

Try asking on a Django forum, since this isn't a question specific to Wing and we don't have the expertise to help with it.

Wingware Support's avatar
4k
Wingware Support
answered 2023-12-07 10:29:48 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer