import pytest
from django.test import TestCase, Client
from django.urls import reverse


class TestViews(TestCase):
    @pytest.mark.unit
    def test_en_translate_page(self):
        """ Test for checking if english version of test page opens """
        client = Client()
        url = reverse('login')
        response = client.get(url[url.find('/', 1):], HTTP_ACCEPT_LANGUAGE='en', follow=True)
        self.assertEqual(response.status_code, 200)

    @pytest.mark.unit
    def test_ru_translate_page(self):
        """ Test for checking if russian version of test page opens """
        client = Client()
        url = reverse('login')
        response = client.get(url[url.find('/', 1):], HTTP_ACCEPT_LANGUAGE='ru', follow=True)
        self.assertEqual(response.status_code, 200)




