Merge pull request #3880 from alphagov/small-follow-up-tweaks

Minor follow-up tweaks from #3878
This commit is contained in:
Ben Thorner
2021-05-12 09:11:01 +01:00
committed by GitHub
3 changed files with 10 additions and 12 deletions

View File

@@ -55,29 +55,27 @@ make run-flask
Then visit [localhost:6012](http://localhost:6012).
Any Python code changes you make should be picked up automatically in development. If you're developing JavaScript code, run `npm run watch` to achieve the same.
## To test the application
```
# install dependencies, etc.
make bootstrap
# run all the tests
make test
# continuously run js tests
npm run test-watch
```
## Common tasks
To run a specific JavaScript test, you'll need to copy the full command from `package.json`.
### Updating application dependencies
## To update application dependencies
`requirements.txt` is generated from the `requirements.in` in order to pin versions of all nested dependencies. If `requirements.in` has been changed, run `make freeze-requirements` to regenerate it.
### Automatically rebuild the frontend assets
If you want the front end assets to re-compile on changes, leave this running in a separate terminal from the app
```shell
npm run watch
```
## Further docs
- [Working with static assets](docs/static-assets.md)

View File

@@ -46,7 +46,7 @@
{% endcall %}
{% if current_user.platform_admin or session.get('disable_platform_admin_view') %}
{% call row() %}
{% call row(id='disable-platform-admin') %}
{{ text_field('Use platform admin view') }}
{{ text_field('Yes' if not session.get('disable_platform_admin_view') else 'No') }}
{{ edit_field('Change', url_for('.user_profile_disable_platform_admin_view')) }}

View File

@@ -23,7 +23,7 @@ def test_overview_page_shows_disable_for_platform_admin(
client_request.login(platform_admin_user)
page = client_request.get(('main.user_profile'))
assert page.select_one('h1').text.strip() == 'Your profile'
disable_platform_admin_row = page.select('tr')[-1]
disable_platform_admin_row = page.select_one('#disable-platform-admin')
assert ' '.join(disable_platform_admin_row.text.split()) == 'Use platform admin view Yes Change'