def create_letter_brand():
    data = request.get_json()

    validate(data, post_letter_branding_schema)

    letter_branding = LetterBranding(**data)
    dao_create_letter_branding(letter_branding)

    return jsonify(letter_branding.serialize()), 201
예제 #2
0
def create_letter_branding(name='HM Government', filename='hm-government'):
    test_domain_branding = LetterBranding(name=name,
                                          filename=filename,
                                          )
    db.session.add(test_domain_branding)
    db.session.commit()
    return test_domain_branding
예제 #3
0
def test_dao_create_letter_branding(notify_db_session):
    data = {'name': 'test-logo', 'filename': 'test-logo'}
    assert LetterBranding.query.count() == 0
    dao_create_letter_branding(LetterBranding(**data))

    assert LetterBranding.query.count() == 1

    new_letter_branding = LetterBranding.query.first()
    assert new_letter_branding.name == data['name']
    assert new_letter_branding.filename == data['name']
예제 #4
0
def test_dao_create_letter_branding(notify_db_session):
    data = {"name": "test-logo", "filename": "test-logo"}
    assert LetterBranding.query.count() == 0
    dao_create_letter_branding(LetterBranding(**data))

    assert LetterBranding.query.count() == 1

    new_letter_branding = LetterBranding.query.first()
    assert new_letter_branding.name == data["name"]
    assert new_letter_branding.filename == data["name"]