These are chat archives for django/django

27th
Jun 2016
Alexey Kalinin
@Alkalit
Jun 27 2016 11:54

I have a problem with selenium testing in django. My very first test looks this
http://pastebin.com/pZbjajXY

I launching it with this command
python manage.py test accounts.tests.test_selenium

The problem is that it fails during user registration for there is no location with id=settings.DEFAULT_LOCATION_ID. It's just disappears after this row:

self.browser.find_element_by_css_selector('input[name="register_1"]').click()

And in log file: http://pastebin.com/FdAgYLvU
I mean, I create this model at test case start and it exist just before this row (I can put ipdb and inspect my models), but somehow during it I get no Locations in DB. It's just disappears.

Alexey Kalinin
@Alkalit
Jun 27 2016 12:44
Hm, seems it's work with import time; time.sleep(3) after submit form. But I dont know why.
Eduardo Buganemi Botelho
@eduardorioterra
Jun 27 2016 15:02
Hi i want to use a image viewer on my site, like a slideshow, which one do you recommend me?
harshit-j
@harshit-j
Jun 27 2016 19:15
Could anyone please make me understand the answer of this stackoverflow question?
http://stackoverflow.com/questions/18880152/allow-a-user-to-vote-only-once-django
Where is Voter id used here? I don't see how Voter id is creating problem when
voters = [user.id for user in Voter.objects.filter(poll__id=poll_id)]
if request.user.id in voters:
this code is only filtering Voter objects on the basis of poll and user ids