Exemplo n.º 1
0
def test_invalid_from_field():
    a = postman.sendgrid.deliver("", "*****@*****.**", "Delivery of your good", "Hey Bahadir, delivery will be late")

    expected_result = {'status': 400,
                       'result': {u'message': u'error', u'errors': [u'Empty from email address (required)']},
                       'success': False}
    print a
    match_result(a, expected_result)
Exemplo n.º 2
0
def test_empty_text_field_fails():
    a = postman.sendgrid.deliver("*****@*****.**", "*****@*****.**", "", "")

    expected_result = {'status': 400,
                       'result': {u'message': u'error', u'errors': [u'Missing email body']},
                       'success': False}
    print a
    match_result(a, expected_result)
Exemplo n.º 3
0
def test_empty_text_field_fails():
    a = postman.mailgun.deliver("*****@*****.**", "*****@*****.**", "",
                                "")

    expected_result = {
        'status': 400,
        'result': {
            u'message':
            u"Need at least one of 'text' or 'html' parameters specified"
        },
        'success': False
    }

    match_result(a, expected_result)
Exemplo n.º 4
0
def test_invalid_from_field_fails():
    a = postman.mailgun.deliver("[email protected]", "*****@*****.**",
                                "Delivery of your good",
                                "Hey Bahadir, delivery will be late")

    expected_result = {
        'status': 400,
        'result': {
            u'message':
            u"'from' parameter is not a valid address. please check documentation"
        },
        'success': False
    }

    match_result(a, expected_result)
Exemplo n.º 5
0
def test_send():
    a = postman.sendgrid.deliver("*****@*****.**", "*****@*****.**", "Delivery of your good", "Hey Bahadir, delivery will be late")
    print a

    match_result(a, {'status': 200, 'result': {'message': 'success'}})