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
Conversation
b64bb82
to
d84c6e1
Compare
1de06d1
to
1d5ca40
Compare
3ab8ff4
to
588d640
Compare
@sbrunner: Why do you closed this PR ? For me it should be rebased on master. |
I delete the branch use_node_modules_jinja2, and probably GitHub automatically close this pull request ... |
1d5ca40
to
1555634
Compare
@@ -1 +1 @@ | |||
-e git://github.com/camptocamp/c2cgeoform.git@9718b29415707d08fecfdced62cb165a64826f2e#egg=c2cgeoform | |||
-e git://github.com/camptocamp/c2cgeoform.git@123561e963e43b765040e973c92599159cbd2170#egg=c2cgeoform |
There was a problem hiding this comment.
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
There was a problem hiding this 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') |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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::*") |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
1555634
to
d6f10a3
Compare
877d388
to
1555634
Compare
Superseeded by #3208 |
linked to camptocamp/c2cgeoform#117
camptocamp/c2cgeoform@17def80