mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Add create_letter_branding method to letter branding client
This commit is contained in:
@@ -6,5 +6,13 @@ class LetterBrandingClient(NotifyAdminAPIClient):
|
|||||||
def get_letter_branding(self):
|
def get_letter_branding(self):
|
||||||
return self.get(url='/dvla_organisations')
|
return self.get(url='/dvla_organisations')
|
||||||
|
|
||||||
|
def create_letter_branding(self, filename, name, domain):
|
||||||
|
data = {
|
||||||
|
"filename": filename,
|
||||||
|
"name": name,
|
||||||
|
"domain": domain,
|
||||||
|
}
|
||||||
|
return self.post(url="/letter-branding", data=data)
|
||||||
|
|
||||||
|
|
||||||
letter_branding_client = LetterBrandingClient()
|
letter_branding_client = LetterBrandingClient()
|
||||||
|
|||||||
@@ -7,3 +7,17 @@ def test_get_letter_branding(mocker):
|
|||||||
mock_get.assert_called_once_with(
|
mock_get.assert_called_once_with(
|
||||||
url='/dvla_organisations'
|
url='/dvla_organisations'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_letter_branding(mocker):
|
||||||
|
new_branding = {'filename': 'uuid-test', 'name': 'my letters', 'domain': 'example.com'}
|
||||||
|
|
||||||
|
mock_post = mocker.patch('app.notify_client.letter_branding_client.LetterBrandingClient.post')
|
||||||
|
|
||||||
|
LetterBrandingClient().create_letter_branding(
|
||||||
|
filename=new_branding['filename'], name=new_branding['name'], domain=new_branding['domain']
|
||||||
|
)
|
||||||
|
mock_post.assert_called_once_with(
|
||||||
|
url='/letter-branding',
|
||||||
|
data=new_branding
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user