MaximCherchuk

test_user_reg

Aug 1st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import pytest
  2.  
  3. from yunojuno.apps.profiles.views.user_registration_views import (
  4.     select_user_type,
  5. )
  6. from django.test.client import RequestFactory
  7.  
  8.  
  9. @pytest.mark.django_db
  10. def test_select_user_type():
  11.     request = RequestFactory()
  12.     request.session = {}
  13.     request.POST = {'user_type': 'freelancer'}
  14.     request.method = 'POST'
  15.  
  16.     response = select_user_type(request)
  17.     assert response.status_code == 302
Advertisement
Add Comment
Please, Sign In to add comment