Ejemplo n.º 1
0
def test_it_is_created_with_name_and_surname():
    assert Receiver('Paweł', 'Niesiołowski')
Ejemplo n.º 2
0
def create_receiver():
    receiver = Receiver('Paweł', 'Niesiołowski')
    receiver.save()
Ejemplo n.º 3
0
def test_it_raises_error_when_surname_is_to_short():
    with pytest.raises(AssertionError):
        Receiver('Paweł', 'N')
Ejemplo n.º 4
0
def test_it_can_be_deleted():
    receiver = Receiver('Paweł', 'Niesiołowski')
    receiver.delete()
    assert receiver.deleted_at
Ejemplo n.º 5
0
def test_it_raises_error_when_name_is_to_short():
    with pytest.raises(AssertionError):
        Receiver('A', 'Niesiołowski')
Ejemplo n.º 6
0
def test_it_raises_error_when_surname_is_to_long():
    surname = 'Abcdefghijabcdefghijabcd-Abcdefghijabcdefghijabcde Abcde'
    with pytest.raises(AssertionError):
        Receiver('Paweł', surname)
Ejemplo n.º 7
0
def test_it_raises_error_when_name_is_to_long():
    with pytest.raises(AssertionError):
        Receiver('Abcdefghijabcdefghijabcdef', 'Niesiołowski')
Ejemplo n.º 8
0
def test_it_raises_error_with_empty_surname():
    with pytest.raises(AssertionError):
        Receiver('Paweł', None)
Ejemplo n.º 9
0
def test_it_raises_error_with_empty_name():
    with pytest.raises(AssertionError):
        Receiver(None, 'Niesiołowski')
Ejemplo n.º 10
0
def test_it_raises_error_with_surname_equals_empty_string():
    with pytest.raises(AssertionError):
        Receiver('Paweł', '')
Ejemplo n.º 11
0
def test_it_raises_error_with_name_equals_empty_string():
    with pytest.raises(AssertionError):
        Receiver('', 'Niesiołowski')