Пример #1
0
def test_save():
    m = Message(data={})
    m.save()
    assert len(m.key) == 40
Пример #2
0
def test_string_representation():
    m = Message(
        key='1' * 40,
        data={'subject': 'hello', 'to': ['*****@*****.**']},
    )
    assert m.__str__() == 'hello to [email protected]'
Пример #3
0
def test_unicode_representation():
    m = Message(
        key='1' * 40,
        data={'subject': 'héllô', 'to': ['*****@*****.**']},
    )
    assert m.__str__() == 'héllô to [email protected]'
Пример #4
0
def test_absolute_url():
    m = Message(key='1' * 40)
    assert m.get_absolute_url()