Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit cf33911

Browse files
author
philippe VESSIERE
committed
Fix #130 - Validate IP format in session
. Add a new IPAddressField type. . Update IP type from CharField to IPAddressField. . Add a new Session factory test to know if a session can be instanciated. . Add 2 session tests (IP valid & IP not valid test).
1 parent 9c523a4 commit cf33911

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ban/tests/auth/test_session.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_session_can_be_created_with_a_client_and_an_valid_IPAddress():
3737
assert session.ip == '192.168.0.1'
3838

3939

40-
def test_session_can_not_be_created_with_a_client_and_an_unvalid_IPAddress():
40+
def test_session_can_not_be_created_with_a_client_and_an_invalid_IPAddress():
4141
client = ClientFactory()
4242
with pytest.raises(ValueError):
4343
models.Session.create(client=client, ip='999.999.999.999')
@@ -49,7 +49,7 @@ def test_session_can_be_created_with_a_user_and_an_valid_IPAddress():
4949
assert session.ip == '192.168.0.1'
5050

5151

52-
def test_session_can_not_be_created_with_a_user_and_an_unvalid_IPAddress():
52+
def test_session_can_not_be_created_with_a_user_and_an_invalid_IPAddress():
5353
user = UserFactory()
5454
with pytest.raises(ValueError):
5555
models.Session.create(user=user, ip='999.999.999.999')

0 commit comments

Comments
 (0)