Commit Graph

7170 Commits

Author SHA1 Message Date
pyup-bot
a3bde8f948 Update pytest-xdist from 1.22.0 to 1.22.1 2018-02-19 22:28:29 +00:00
chrisw
dd2231056d organisation dashboard page 2018-02-19 16:56:16 +00:00
Ken Tsang
c1e3658a8f Add load org before request to allow current_org to be accessible from request context 2018-02-19 16:56:16 +00:00
chrisw
96b66829a1 organisation-dashboard 2018-02-19 16:56:16 +00:00
Chris Hill-Scott
41425481b3 Merge pull request #1878 from alphagov/pyup-update-pytest-mock-1.6.3-to-1.7.0
Update pytest-mock to 1.7.0
2018-02-19 10:38:26 +00:00
pyup-bot
29643231f9 Update eventlet from 0.22 to 0.22.1 2018-02-17 18:24:25 +00:00
pyup-bot
11f43988e3 Update pytest-mock from 1.6.3 to 1.7.0 2018-02-16 21:23:23 +00:00
Rebecca Law
b8239085f5 Merge pull request #1874 from alphagov/add-min-validation-for-sms-sender
Added a validation for a minimum of 3 character.
2018-02-15 17:18:04 +00:00
Rebecca Law
2b739535d4 Added an edge case test 2018-02-15 16:39:42 +00:00
Rebecca Law
6bd99e0599 Added a validation for a minimum of 3 character.
If the SMS sender is less than 3 characters one of our providers will return an error.
2018-02-15 16:06:44 +00:00
Rebecca Law
fcc5c4e3e9 Merge pull request #1871 from alphagov/remove-allow-pdf-button
Remove allow/stop send pdf letters button
2018-02-15 09:45:46 +00:00
Rebecca Law
3f52454691 Remove allow/stop send pdf letters button.
Now that we only use the pdf letter flow, we can remove the button for the platform admin users.
2018-02-14 17:09:13 +00:00
Chris Hill-Scott
24a82b4812 Merge pull request #1870 from alphagov/147-153
147-153 services and 62-63 organisations
2018-02-14 16:30:27 +00:00
Chris Hill-Scott
56969c2379 Merge pull request #1865 from alphagov/no-slash-dashboard
Remove dashboard from dashboard URL
2018-02-14 16:30:17 +00:00
Pete Herlihy
3d26d4563b 147-153 services and 62-63 organisations
MoJ O2 Transition Project – Ministry of Justice
Academies Financial Reporting Division – Department for Education
Money Claims Service Line – HM Courts & Tribunals Service
HR and Organisational Development – Calderdale Council
Family & Civil Service Line – HM Courts & Tribunals Service
Electronic Patient Discharge Questionnaire – Public Health England
2018-02-14 16:19:52 +00:00
Leo Hemsted
5005a0db51 Merge pull request #1864 from alphagov/pytest-env
Automatically set environment vars before tests
2018-02-14 15:11:53 +00:00
Leo Hemsted
7322cf126b Merge pull request #1869 from alphagov/email-validation
validate email addresses in one-off flow
2018-02-14 15:11:44 +00:00
Leo Hemsted
e8f262c632 Merge pull request #1867 from alphagov/fail-fast
Stop pytest on 10th failing test
2018-02-14 15:11:35 +00:00
Leo Hemsted
31a4cc15c9 validate email addresses in one-off flow
previously we were just using the wtforms builtin email validator,
which is much more relaxed than our own one. It'd catch bad emails when
POSTing to the API, resulting in an ugly error message. It's easy work
to make sure we validate email addresses as soon as they're entered.
2018-02-14 14:35:16 +00:00
Chris Hill-Scott
14b5f9e778 Allow up to 10 tests to fail before stopping
This is a sensible compromise between 1 test and ALL THE TESTS.

Uses the `maxfail` option as documented here:
https://docs.pytest.org/en/latest/usage.html#stopping-after-the-first-or-n-failures
2018-02-14 13:25:41 +00:00
Chris Waszczuk
34f1b40dbc Merge pull request #1858 from gov-cjwaszczuk/link-service-to-organisation
Link services to organisations (Admin)
2018-02-14 12:30:15 +00:00
Katie Smith
8bbfde5845 Merge pull request #1861 from alphagov/let-service-change-punctuation-in-name
Pass service_id through to API '/service/unique' endpoint
2018-02-14 11:53:03 +00:00
Katie Smith
a4145a6a13 Merge pull request #1866 from alphagov/leohemsted-patch-2
Update requirements.txt
2018-02-14 11:52:52 +00:00
Chris Hill-Scott
9f275d2a0b Stop pytest on first failing test
If a PR is going to fail because tests aren’t passing then you:
- should know about it as quick as possible
- shouldn’t waste precious Jenkins CPU running subsequent tests

This commit adds the `-x` flag to pytest, which stops the test run as
soon as one failing test is discovered.
2018-02-14 11:50:51 +00:00
Leo Hemsted
9716983f83 Update requirements.txt
email validation
2018-02-14 11:31:29 +00:00
Chris Hill-Scott
513c64be64 Remove environment_test.sh
These config variables are now set in `pytest.ini` instead.
2018-02-14 11:28:15 +00:00
Chris Hill-Scott
3a03f11013 Automatically set environment vars before tests
Sometimes you just wanna run some tests directly using the `pytest`
command. But you’re in a new shell, and have forgotten to do
`source environment_test.sh`. The screen fills with red, and your day
just got a little bit worse.

This commit will stop this from ever happening again, by making the
setting environment variables part of running Pytest. It does this with
a plugin called pytest-env[1].

pytest.ini is the standard way of configuring pytest. Creating this file
where it didn’t exist before changes the behaviour of pytest, in that
it will now look for tests in the same directory as the file, rather
than defaulting to the `tests/` directory. So we also have to explicitly
configure pytest[2] to tell it that it should only look in this
directory. Otherwise it gets lost in the weeds of `node_modules`.

1. https://github.com/MobileDynasty/pytest-env
2. https://docs.pytest.org/en/latest/customize.html#confval-testpaths
2018-02-14 10:43:29 +00:00
Chris Hill-Scott
95482363aa Remove dashboard from dashboard URL
It’s weird that `/services/<service_id>` returns `404`. The home page
for every service is the dashboard – should be possible to get there
from any other page just by stemming the URL.

Also makes it consistent with organisations, which will have
`/organisations/<org_id>`.
2018-02-14 10:39:44 +00:00
Katie Smith
84d810b981 Pass service_id through to API '/service/unique' endpoint
Notifications-api now needs the service_id to check the uniqueness of
the service name when trying to change it. This is to allow a user to
successfully change the pluralization or the case of their service name.
2018-02-13 15:57:19 +00:00
Leo Hemsted
0f20cfe8bc Merge pull request #1857 from alphagov/logging
don't log 404s as ERROR
2018-02-13 14:17:03 +00:00
chrisw
1450138b9c link-services-to-organisations 2018-02-13 12:49:57 +00:00
Leo Hemsted
08fb149b5f don't log 404s as ERROR 2018-02-12 16:02:33 +00:00
Chris Hill-Scott
01a2852a69 Merge pull request #1849 from alphagov/pyup-update-pytz-2017.3-to-2018.3
Update pytz to 2018.3
2018-02-12 15:07:16 +00:00
Chris Hill-Scott
bf8ba544d1 Merge pull request #1836 from alphagov/pyup-update-notifications-python-client-4.7.1-to-4.7.2
Update notifications-python-client to 4.7.2
2018-02-12 15:03:05 +00:00
Chris Hill-Scott
1f9025caa0 Merge pull request #1855 from alphagov/pyup-update-flake8-print-3.0.1-to-3.1.0
Update flake8-print to 3.1.0
2018-02-12 14:17:19 +00:00
kentsanggds
9401703a0d Merge pull request #1846 from alphagov/add-organisations
Add organisations
2018-02-12 13:25:03 +00:00
Ken Tsang
35571e741c Refactor manage-organisation.html, organisations.html 2018-02-12 12:27:06 +00:00
Ken Tsang
11a7fc49b7 Renamed create to add for organisations 2018-02-12 12:27:06 +00:00
Ken Tsang
a200f1a17e Go to organisation stub page which will eventually show list of services 2018-02-12 12:27:06 +00:00
Ken Tsang
d4c6491c93 Add title 2018-02-12 12:27:06 +00:00
Ken Tsang
f0e8661e34 Add organisations pages to show orgs and create/edit them 2018-02-12 12:27:06 +00:00
Ken Tsang
b11bfd49e3 Add Organisations API Client 2018-02-12 12:27:06 +00:00
Ken Tsang
4eea97c83b Add organisation to platform admin navigation 2018-02-12 12:27:06 +00:00
Chris Hill-Scott
3f5d9f418b Merge pull request #1856 from alphagov/diff-dom-update
Fix bug with disappearing AJAX content in IE 9/10
2018-02-12 12:17:50 +00:00
Chris Hill-Scott
35e7260d6f Fix bug with disappearing AJAX content in IE 9/10
We had a user report that the ‘inbound messages’ part of their dashboard
was appearing for a split second then disappearing.

This was caused by the Javascript on the page throwing an exception as
it was trying to re-render this part of the page. This meant it gave up
and rendered nothing.

The exception was caused by passing `undefined` as the second argument
to `.insertBefore`. This is acceptable in most browsers, but not older
versions of IE. This is fixed in the latest version of diffDOM (the 3rd
party library we use to do the AJAX stuff) by defaulting the second
argument to `.insertBefore` to `null`, which is acceptable in old IE
versions.

See the fix here: 8833d87e9d
2018-02-12 11:39:38 +00:00
Chris Hill-Scott
5efc86bbcc Remove flag from flake8 command
This flag was only needed because of a bug in flake8. This bug is fixed
now.
2018-02-12 10:26:55 +00:00
pyup-bot
4058a9f45f Update flake8-print from 3.0.1 to 3.1.0 2018-02-11 16:39:14 +00:00
Chris Hill-Scott
13f3e8d933 Merge pull request #1850 from alphagov/email-auth-host
Tell API what URL to use for email auth links
2018-02-09 17:02:46 +00:00
Chris Hill-Scott
52241b8f3e Use client from app in tests
Means we don’t have to instantiate it in every test, keeps things
consistent with parent commit.
2018-02-09 15:04:52 +00:00
Chris Hill-Scott
1908e7b091 Tell API what URL to use for email auth links
So that we can keep people on the prototype URL when doing user
research.

Depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/1645
2018-02-09 15:01:20 +00:00