"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from django.test import TestCase


class SimpleTest(TestCase):
    def test_basic_addition(self):
        """
        Tests that 1 + 1 always equals 2.
        """
        self.assertEqual(1 + 1, 2)

@@ -1,351 +1,760 @@
-%22%22%22%0AThis file demonstrates writing tests using the unittest module. These will pass%0Awhen you run %22manage.py test%22.%0A%0AReplace this with more appropriate tests for your application.%0A%22%22%22%0A%0Afrom django.test import TestCase%0A%0A%0Aclass SimpleTest(TestCase):%0A    def test_basic_addition(self):%0A        %22%22%22%0A        Tests that 1 + 1 always equals 2.%0A        %22%22%22
+from django.test import TestCase%0A%0Afrom .settings import oauth2_settings%0Afrom .generators import BaseHashGenerator, generate_client_id, generate_client_secret%0A%0A%0Aclass MockHashGenerator(BaseHashGenerator):%0A    def hash(self):%0A        return 42%0A%0A%0Aclass TestGenerators(TestCase):%0A    def test_generate_client_id(self):%0A        g = oauth2_settings.CLIENT_ID_GENERATOR_CLASS()%0A        self.assertEqual(len(g.hash()), 40)%0A%0A        oauth2_settings.CLIENT_ID_GENERATOR_CLASS = MockHashGenerator%0A        self.assertEqual(generate_client_id(), 42)%0A%0A    def test_generate_secret_id(self):%0A        g = oauth2_settings.CLIENT_SECRET_GENERATOR_CLASS()%0A        self.assertEqual(len(g.hash()), 128)%0A%0A        oauth2_settings.CLIENT_SECRET_GENERATOR_CLASS = MockHashGenerator
 %0A   
@@ -779,14 +779,34 @@
 ual(
-1 + 1
+generate_client_secret()
 , 
+4
 2)%0A

test generators and settings interactions