@@ -0,0 +1,2531 @@
+from django.test import Client, TestCase%0Afrom django.core.urlresolvers import reverse%0Afrom breach.models import Target%0Afrom breach.views import VictimListView%0Aimport json%0A%0A%0Aclass ViewsTestCase(TestCase):%0A    def setUp(self):%0A        self.client = Client()%0A%0A        self.target1 = Target.objects.create(%0A            name='ruptureit',%0A            endpoint='https://ruptureit.com/test.php?reflection=%25s',%0A            prefix='imper',%0A            alphabet='abcdefghijklmnopqrstuvwxyz',%0A            secretlength=9,%0A            alignmentalphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ',%0A            recordscardinality=1,%0A            method=1%0A        )%0A%0A        self.target2 = Target.objects.create(%0A            name='ruptureit2',%0A            endpoint='https://ruptureit.com/test.php?reflection=%25s',%0A            prefix='imper',%0A            alphabet='abcdefghijklmnopqrstuvwxyz',%0A            secretlength=9,%0A            alignmentalphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ',%0A            recordscardinality=1,%0A            method=2%0A        )%0A%0A        self.target1_data = %7B%0A            'name': 'ruptureit',%0A            'endpoint': 'https://ruptureit.com/test.php?reflection=%25s',%0A            'prefix': 'imper',%0A            'alphabet': 'abcdefghijklmnopqrstuvwxyz',%0A            'secretlength': 9,%0A            'alignmentalphabet': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',%0A            'recordscardinality': 1,%0A            'method': 1%0A        %7D%0A%0A        self.target2_data = %7B%0A            'name': 'ruptureit2',%0A            'endpoint': 'https://ruptureit.com/test.php?reflection=%25s',%0A            'prefix': 'imper',%0A            'alphabet': 'abcdefghijklmnopqrstuvwxyz',%0A            'secretlength': 9,%0A            'alignmentalphabet': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',%0A            'recordscardinality': 1,%0A            'method': 2%0A        %7D%0A%0A    def test_target_post(self):%0A        %22%22%22%0A        Test post requests for /target%0A        %22%22%22%0A        # Create the request%0A        data = %7B%0A            'name': 'ruptureit3',%0A            'endpoint': 'https://ruptureit.com/test.php?reflection=%25s',%0A            'prefix': 'imper',%0A            'alphabet': 'abcdefghijklmnopqrstuvwxyz',%0A            'secretlength': 9,%0A            'alignmentalphabet': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',%0A            'recordscardinality': 1,%0A            'method': 1%0A        %7D%0A        response = self.client.post(reverse('TargetView'), json.dumps(data), content_type='application/json')%0A%0A        self.assertEqual(response.status_code, 200)%0A        self.assertEqual(json.loads(response.content)%5B'target_name'%5D, 'ruptureit3')%0A

Add test for /target post