<commit_before>from django.conf import settings
from django.test import TestCase
from .models import Profile
import factory
# Create your tests here.


class UserFactory(factory.django.DjangoModelFactory):
    """Factory for User."""

    class Meta:
        model = settings.AUTH_USER_MODEL


class ProfileFactory(factory.django.DjangoModelFactory):
    """Factory for profile."""

    class Meta:
        model = Profile


class ProfileTestCase(TestCase):
    """Class for testing profile."""

    def setUp(self):
        """Setup test subject."""
        self.user = UserFactory.create(
            username='frand',
            email='<EMAIL>',
            password='<PASSWORD>'
        )

        self.Profile = ProfileFactory.create(
            camera='Polaroid',
            picture_subject='Grazing sheepz',
            user=self.user,
            location="Code Fellows' non-existent kitchen",
        )

    def test_user(self):
        """Test user."""
        self.assertIs(self.user.username, 'frand')
        self.assertTrue(bool(self.user.email))
        self.assertIs(self.user.password, '<PASSWORD>')

    def test_camera(self):
        """Test camera."""
        self.assertIs(self.Profile.camera, 'Polaroid')
        self.assertIsNot(self.Profile.camera, 'Hame')

    def test_subject(self):
        """Test subject."""
        self.assertTrue(self.Profile.picture_subject, 'Grazing sheepz')
        self.assertIsNot(self.Profile.picture_subject, 'Dumb')

    def test_ownership(self):
        """Test Profile is same as user."""
        self.assertEqual(self.Profile.user, self.user)

    def test_location(self):
        """Test location."""
        self.assertTrue(self.Profile.location,
                        "Code Fellows' non-existent kitchen"
                        )
        self.assertIsNot(self.Profile.location, "Happily asleep")

    def tearDown(self):
        """Tear down the stuff made in setup/need to make work."""
        pass<commit_msg>added http tests, all passing. tried to create test folder and hit errors<commit_after>from django.conf import settings
from django.test import TestCase
from django.test import Client
from .models import Profile
import unittest
import factory


class UserFactory(factory.django.DjangoModelFactory):
    """Factory for User."""

    class Meta:
        model = settings.AUTH_USER_MODEL


class ProfileFactory(factory.django.DjangoModelFactory):
    """Factory for profile."""

    class Meta:
        model = Profile


class ProfileTestCase(TestCase):
    """Class for testing profile."""

    def setUp(self):
        """Setup test subject."""
        self.user = UserFactory.create(
            username='frand',
            email='<EMAIL>',
            password='<PASSWORD>'
        )

        self.Profile = ProfileFactory.create(
            camera='Polaroid',
            picture_subject='Grazing sheepz',
            user=self.user,
            location="Code Fellows' non-existent kitchen",
        )

    def test_user(self):
        """Test user."""
        self.assertIs(self.user.username, 'frand')
        self.assertTrue(bool(self.user.email))
        self.assertIs(self.user.password, '<PASSWORD>')

    def test_camera(self):
        """Test camera."""
        self.assertIs(self.Profile.camera, 'Polaroid')
        self.assertIsNot(self.Profile.camera, 'Hame')

    def test_subject(self):
        """Test subject."""
        self.assertTrue(self.Profile.picture_subject, 'Grazing sheepz')
        self.assertIsNot(self.Profile.picture_subject, 'Dumb')

    def test_ownership(self):
        """Test Profile is same as user."""
        self.assertEqual(self.Profile.user, self.user)

    def test_location(self):
        """Test location."""
        self.assertTrue(self.Profile.location,
                        "Code Fellows' non-existent kitchen"
                        )
        self.assertIsNot(self.Profile.location, "Happily asleep")

    def tearDown(self):
        """Tear down the stuff made in setup/need to make work."""
        pass


class HttpTests(unittest.TestCase):
    """Test url routes."""

    def setUp(self):
        """Set up client."""
        self.client = Client()

    def test_home(self):
        """Test home exist."""
        response = self.client.get('/')
        self.assertEqual(response.status_code, 200)

    def test_register_security(self):
        """Test csrf security on register."""
        response = self.client.get('/accounts/register')
        self.assertEqual(response.status_code, 301)

    def test_login_security(self):
        """Test csrf security on login."""
        response = self.client.get('/accounts/login')
        self.assertEqual(response.status_code, 301)

    def test_logout_security(self):
        """Test existence on security."""
        response = self.client.get('/accounts/logout')
        self.assertEqual(response.status_code, 301)

    def test_error(self):
        """Test client reliability requests."""
        response = self.client.get('/potato')
        self.assertEqual(response.status_code, 404)
{'fraction_non_alphanumeric': 0.12369509552885562, 'fraction_numerical': 0.0029545006893834944, 'mean_word_length': 2.5141868512110728, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4103830', 'n_tokens_mistral': 1414, 'n_tokens_neox': 1362, 'n_words': 322}