Skip to content
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

[admin] delete user from grid #3151

Closed
wants to merge 3 commits into from
Closed

[admin] delete user from grid #3151

wants to merge 3 commits into from

Conversation

cmangeat
Copy link
Contributor

@cmangeat cmangeat commented Oct 6, 2017

@cmangeat cmangeat changed the base branch from commons_cleaning_pr_cmt_bak to master October 9, 2017 06:38
@cmangeat cmangeat force-pushed the admin_delete branch 2 times, most recently from b64bb82 to d84c6e1 Compare October 12, 2017 16:18
@cmangeat cmangeat changed the base branch from master to use_node_modules_jinja2 October 12, 2017 16:27
@cmangeat cmangeat force-pushed the admin_delete branch 2 times, most recently from 1de06d1 to 1d5ca40 Compare October 13, 2017 08:39
@arnaud-morvan arnaud-morvan force-pushed the use_node_modules_jinja2 branch 2 times, most recently from 3ab8ff4 to 588d640 Compare October 13, 2017 11:27
@sbrunner sbrunner closed this Oct 16, 2017
@sbrunner sbrunner deleted the admin_delete branch October 16, 2017 06:55
@arnaud-morvan
Copy link
Member

@sbrunner: Why do you closed this PR ? For me it should be rebased on master.

@sbrunner
Copy link
Member

I delete the branch use_node_modules_jinja2, and probably GitHub automatically close this pull request ...

@sbrunner sbrunner changed the base branch from use_node_modules_jinja2 to master October 16, 2017 07:56
@sbrunner sbrunner restored the admin_delete branch October 16, 2017 07:56
@sbrunner sbrunner reopened this Oct 16, 2017
@@ -1 +1 @@
-e git://github.com/camptocamp/c2cgeoform.git@9718b29415707d08fecfdced62cb165a64826f2e#egg=c2cgeoform
-e git://github.com/camptocamp/c2cgeoform.git@123561e963e43b765040e973c92599159cbd2170#egg=c2cgeoform
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to be updated after camptocamp/c2cgeoform#117 is merged

Copy link
Member

@arnaud-morvan arnaud-morvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a general side, I would prefer test only the things related to delete in delete, here are duplicates of other tests, it increase the complexity and difficulty to understand the test code.

@@ -35,3 +35,7 @@ def view(self):
renderer="../templates/edit.jinja2")
def save(self):
return super().save()

@view_config(route_name='c2cgeoform_delete')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be updated accordingly to routes in c2cgeoform after merge of camptocamp/c2cgeoform#117

req.referer = 'this is a test, TestUser-test_delete'
req.matchdict.update({'id': str(user_id)})

UserViews(req).delete()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer we pass through the entire app using test_app


user = dbsession.query(User).filter(User.id == user_id).one_or_none()
assert user is None

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me test of return status and location header is missing here

selenium.get('http://127.0.0.1:6543' + '/user/')
elem = selenium.find_element_by_xpath("//div[@class='infos']")
assert 'Showing 1 to 10 of 23 entries' == elem.text
main_window_handle = selenium.current_window_handle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main_window_handle seems unused

one().id
selenium.get('http://127.0.0.1:6543' + '/user/')
elem = selenium.find_element_by_xpath("//div[@class='infos']")
assert 'Showing 1 to 10 of 23 entries' == elem.text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related with delete ?

Copy link
Contributor Author

@cmangeat cmangeat Oct 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensuring that there 23 entries before delete, then 22 after delete, also that all entries can be read on the same page (50 per pages, i.e. more than 22) and that the good one disappear.

elem.click()
elem = selenium.find_element_by_xpath("//a[contains(@href,'" +
str(user_id) +
"/edit')]/following-sibling::*")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that delete will stay the edit following-sibling, this is hard to understand, is it not possible to get the delete button directly ?

Copy link
Contributor Author

@cmangeat cmangeat Oct 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add a ref for this in template at c2cgeoform template side, no sure that we want to (for delete, id is lost somewhere in a js var)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have tu put a class on it for the icon, this could be addressed in this PR too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon don't carry id ! e.g. user.id.

elem = selenium.find_element_by_xpath("//div[@class='infos']")
assert 'Showing 1 to 10 of 22 entries' == elem.text
elem = selenium.find_element_by_xpath("//button[@title='Refresh']/following-sibling::*")
elem.click()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it stricly neccessary to do such many refreshes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that gecko driver need a little time to shift focus exiting alert window. I Prefer calling refresh than adding tempo.

@arnaud-morvan
Copy link
Member

Superseeded by #3208

@sbrunner sbrunner deleted the admin_delete branch October 27, 2017 12:21
@sbrunner sbrunner added this to the dummy milestone Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants