-
Notifications
You must be signed in to change notification settings - Fork 192
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
running the tests deletes the default user #2407
Comments
I think you copied only part of the error. What does Probably it's possible that there is no way of setting a default user and a new command should be added to |
thanks for pointing this out - fixed!
Indeed, there is a default user specified but it doesn't show up in
I guess you mean
Either to verdi user or, perhaps, rather to |
I see, so the problem is that the user is not in the DB, right? Do you know how this happened? |
I don't really know - but it might be my fault in some way. Let's for the moment assume it is my fault. I would still say that we need to decide whether having no default user is allowed or not. Currently, part of the codebase seems to assume that it cannot happen (while it can), which would mean we should raise an exception, ideally with instructions on how to make a user the default one. |
Just mentioning that @waychal had exactly the same problem (no default user, no users showing up in Furthermore, I had the user that I previously configured via |
Just happened again to me as well: the users seem to be randomly deleted - i.e. I'm still on the same profile but now |
That's really weird... |
Not sure whether this is related but on PR #2421 I'm getting an error (on python2.7 only) |
One of the problems might have been that I was running on a test database (and might have been running tests). |
I have the feeling this happened in your PR #2214 (but with the commit by @muhrin), where before there was something like # We create the user only once:
# Otherwise, get_automatic_user() will fail when the
# user is recreated because it caches the user!
# In any case, store it in self.user though
try:
self.user = DbUser.objects.get(email=get_configured_user_email())
except ObjectDoesNotExist:
self.user = DbUser.objects.create_user(get_configured_user_email(), 'fakepwd') and now
I think also the deleted comment is quite explicative. Is it possible? I don't know though if @muhrin moved the logic somewhere else |
I think the first code you pasted is not related but the second one in Before: DbUser.objects.exclude(email=get_configured_user_email()).delete() After: DbUser.objects.all().delete() Indeed this would mean that the tests could still pass (since a new default user will be created on demand), but running the tests will always result in deletion of the default user. |
To summarize:
I personally still find it annoying not to have a default user in the database because it means you can't do anything in the shell without setting up the user first. Anyhow, I can also see the argument by spyros. Feel free to close |
Perhaps, the larger question here is what a user is supposed to be able to do with a test profile. If the policy is that you cannot do anything with a test profile other than run the tests, then I think there is actually no need to set it up as a regular profile using |
this last comment will be addressed in #2771, so this can be closed |
I encountered the following error while trying to run my first WorkChain on the new
provenance_redesign
branch, python 2.7.15:This is in a profile that was migrated to the current
provenance_redesign
branch (not created from scratch).To me, this raises a few questions:
orm.User.objects.get_default()
be allowed to returnNone
or should it raise an exception?verdi user
(which worked) but, apparently, this is not enough. How do I make it the default one?Perhaps @giovannipizzi could comment?
The text was updated successfully, but these errors were encountered: