Commit Graph

4674 Commits

Author SHA1 Message Date
kentsanggds
c01aef2c48 Merge pull request #1694 from alphagov/ken-add-precompiled-letter-permission
Add precompiled_letter service permission
2018-02-22 10:27:52 +00:00
Ken Tsang
90e9d99161 Add precompiled_letter service permission
- migration script to add precompiled_letter in service_permission_types table and in service permission types list in models.py
2018-02-21 16:26:49 +00:00
Leo Hemsted
01ed4e1e56 Merge pull request #1679 from alphagov/pyup-update-eventlet-0.22.0-to-0.22.1
Update eventlet to 0.22.1
2018-02-21 16:26:27 +00:00
Leo Hemsted
a5827f9397 Merge pull request #1682 from alphagov/pyup-update-pytest-xdist-1.22.0-to-1.22.1
Update pytest-xdist to 1.22.1
2018-02-21 16:26:10 +00:00
Leo Hemsted
038f37984e Merge pull request #1689 from alphagov/pyup-update-pytest-3.4.0-to-3.4.1
Update pytest to 3.4.1
2018-02-21 16:25:58 +00:00
Leo Hemsted
c173b4b775 Merge pull request #1691 from alphagov/letter-pdf
send letters for services without letters_for_pdf
2018-02-21 16:25:33 +00:00
Leo Hemsted
34e98bc14c send letters for services without letters_for_pdf
also make sure that the service isn't in research mode
2018-02-21 15:59:52 +00:00
Rebecca Law
f248234cfc Merge pull request #1690 from alphagov/command-to-add-inbound-numbers
Added a command to insert inbound numbers from file.
2018-02-21 14:09:17 +00:00
Rebecca Law
28925da575 Fix codestyle 2018-02-21 11:52:52 +00:00
Rebecca Law
9207325501 Added a message about the file format. 2018-02-21 10:30:34 +00:00
Rebecca Law
953a545aea Added a command to insert inbound numbers from file.
Expected file format is one number per line, each phone number should be 07... not 447..
2018-02-21 10:00:17 +00:00
pyup-bot
45af9c14cc Update pytest from 3.4.0 to 3.4.1 2018-02-20 22:10:50 +00:00
pyup-bot
d9032f8562 Update pytest-xdist from 1.22.0 to 1.22.1 2018-02-19 22:29:29 +00:00
Rebecca Law
e750636a57 Merge pull request #1665 from alphagov/reduce-log-level
Reduce logging level
2018-02-19 14:50:30 +00:00
Rebecca Law
927f6e8335 Catch itegrity errors and return 400.
When creating or updating an organisation an itegrity error is raise if the name is already used.
This change adds a new error handler for the organisation to catch the named unique index and return a 400 with a sensible message.
We have an other error handler for unique service names which was caught in the error handler for all blueprints. A new error handler for the service_blueprint has been created for catch those specific unique constraints.
This is a nice way to encapulate the specific errors for a specific blueprint.
2018-02-19 14:33:44 +00:00
Rebecca Law
d6a1e694e2 Merge branch 'master' into reduce-log-level 2018-02-19 11:21:06 +00:00
Chris Hill-Scott
a16a14aba5 Merge pull request #1675 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:43 +00:00
pyup-bot
7638df74a9 Update eventlet from 0.22.0 to 0.22.1 2018-02-17 18:25:26 +00:00
pyup-bot
87788d7a84 Update pytest-mock from 1.6.3 to 1.7.0 2018-02-16 21:24:23 +00:00
Leo Hemsted
3556851df9 Merge pull request #1672 from alphagov/org-users
Org user DB models
2018-02-16 10:57:27 +00:00
Katie Smith
be8b10a2dd Merge pull request #1666 from alphagov/remove-unnecessary-code
Remove unnecessary code to do with testing service name uniqueness
2018-02-15 16:42:43 +00:00
Katie Smith
a6dae2c81b Remove unnecessary code to do with testing service name uniqueness
notifications-admin has now been changed to always pass the service_id
to the 'service/unique' endpoint. This means we don't need to cover the
case of there being no service_id and the tests can also be updated.
2018-02-15 16:32:09 +00:00
Rebecca Law
c94cbb02b1 Merge pull request #1671 from alphagov/fix-uuid-validation
Fix UUID validate in the JSON schema
2018-02-15 14:23:02 +00:00
Leo Hemsted
83b26f4a93 use psycopg2-binary to supress warnings 2018-02-15 14:20:25 +00:00
Leo Hemsted
450deae32a add user_to_organisation and invited_organisation_users tables
similar to user_to_service and invited_users, but without auth types
or permissions
2018-02-15 14:19:24 +00:00
Leo Hemsted
15e31fd6e6 add sms sender to old script
we have problems where govuk service is not migrated to sms_senders on new datbases.
update this old script so we don't affect live systems, but when people rebuild their
database from scratch they get the sms sender for govuk notify.
2018-02-15 14:18:22 +00:00
Rebecca Law
52bf6dabcd The regex to validate uuids was not rejecting uuids with a space at the end.
Switched to using a isinstance check on the string.
Added an order by clause to dao_get_template_usage_stats_by_service, it was causing an itermitten failure in the tests.
2018-02-15 13:34:06 +00:00
Chris Hill-Scott
bacfe79501 Merge pull request #1667 from alphagov/wra
Add letter logo for Welsh Revenue Authority and East Riding of Yorkshire Council
2018-02-15 12:00:02 +00:00
Alexey Bezhan
8a67b714e2 Merge pull request #1651 from alphagov/eventlet-celery-workers-service-callbacks
Switch service callback workers to use eventlet pool implementation
2018-02-15 11:08:54 +00:00
Chris Hill-Scott
f4be8fd80b Add East Riding of Yorkshire Council to migration 2018-02-15 11:08:17 +00:00
Chris Hill-Scott
f55f555e4d Add letter logo for Welsh Revenue Authority
Depends on:
- [ ] https://github.com/alphagov/notifications-template-preview/pull/94
2018-02-15 11:08:16 +00:00
Rebecca Law
019a6ef1e4 Merge pull request #1657 from alphagov/fix-template-versions
Fix template version for admin app
2018-02-15 10:14:58 +00:00
Rebecca Law
4820365b13 Rename migration file so that the force db migration part of the deploy does not trigger 2018-02-15 09:47:28 +00:00
Rebecca Law
a56f3b206f Merge branch 'master' into fix-template-versions 2018-02-15 09:45:56 +00:00
Chris Hill-Scott
de11751919 Merge pull request #1661 from alphagov/pytest-env
Automatically set environment vars before tests
2018-02-15 09:34:49 +00:00
Chris Hill-Scott
781bae2523 Merge pull request #1663 from alphagov/fail-fast
Stop pytest on 10th failing test
2018-02-15 09:34:42 +00:00
Rebecca Law
d8b062a960 Merge pull request #1664 from alphagov/switch-to-pdf-flow
Switch to using the pdf letter flow.
2018-02-14 15:36:12 +00:00
Rebecca Law
6f488bf7c7 Reduce logging level
If the organisation name that is being inserted or updated is not unique we just want to return a 400 to the admin app.
Updated the code so that we are not logging.exception, this is because a cloud watch alert is set to the support team. This type of error is not something we need to investigate.
2018-02-14 14:35:40 +00:00
Rebecca Law
12352a4153 Merge pull request #1635 from alphagov/remove-failed-as-a-status
Remove failed as a possible status
2018-02-14 14:35:01 +00:00
Chris Hill-Scott
faa76755c3 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:27:06 +00:00
Chris Hill-Scott
845aad1183 Remove environment_test.sh
These config variables are now set in `pytest.ini` instead.
2018-02-14 12:19:13 +00:00
Chris Hill-Scott
d36b742e14 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`.

This also changes the way that `SQLALCHEMY_DATABASE_URI` is overriden to
the convention used by this plugin.

1. https://github.com/MobileDynasty/pytest-env
2. https://docs.pytest.org/en/latest/customize.html#confval-testpaths

fixup! Remove environment_test.sh
2018-02-14 12:19:12 +00:00
Chris Hill-Scott
e87ed0f68a 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:54:40 +00:00
Leo Hemsted
15c2a9461e Merge pull request #1658 from alphagov/pyup-update-boto3-1.5.27-to-1.5.28
Update boto3 to 1.5.28
2018-02-14 11:48:35 +00:00
Leo Hemsted
10ebf4ae02 Merge pull request #1659 from alphagov/pyup-update-awscli-1.14.37-to-1.14.38
Update awscli to 1.14.38
2018-02-14 11:48:21 +00:00
Leo Hemsted
4d7a0acaf2 Merge pull request #1662 from alphagov/leohemsted-patch-1
Update requirements.txt
2018-02-14 11:48:10 +00:00
Leo Hemsted
f070b4eab1 Update requirements.txt
email validation
2018-02-14 11:31:17 +00:00
Rebecca Law
94162bc1bf Updated the schema to return reply_to - which is the id and reply_to_text which is the contact_block 2018-02-14 11:20:09 +00:00
Katie Smith
2049e75210 Merge pull request #1656 from alphagov/let-service-change-punctuation-in-name
Allow services to add punctuation to or change the case of their name
2018-02-14 10:22:41 +00:00
Katie Smith
e1cc8175d7 Allow services to add puntuation to or change the case of their name
Changed the '/service/unique' endpoint to optionally accept the
service_id parameter. It now doesn't matter if a user tries to change
the capitalization or add punctuation to their own service name. But
there should still be an error if a user tries to change the punctuation
or capitalization of another service.

service_id needs to be allowed to be None until notifications-admin is
updated to always pass in the service_id.
2018-02-14 10:11:46 +00:00