def setUp(self): factories.make_world() self.pb1 = PublicBody.objects.filter(jurisdiction__slug='bund')[0] self.pb2 = PublicBody.objects.filter(jurisdiction__slug='nrw')[0] ct = ContentType.objects.get_for_model(FoiRequest) self.perm = Permission.objects.get(content_type=ct, codename='create_batch')
def setUp(self): factories.make_world() self.pb1 = PublicBody.objects.filter(jurisdiction__slug='bund')[0] self.pb2 = PublicBody.objects.filter(jurisdiction__slug='nrw')[0] ct = ContentType.objects.get_for_model(FoiRequest) self.perm = Permission.objects.get( content_type=ct, codename='create_batch' )
def setUp(self): self.secret_address = '*****@*****.**' self.site = factories.make_world() self.req = factories.FoiRequestFactory.create(site=self.site, secret_address=self.secret_address, closed=True) factories.FoiMessageFactory.create(request=self.req) factories.FoiMessageFactory.create(request=self.req, is_response=True)
def setUp(self): site = factories.make_world() date = datetime(2010, 6, 5, 5, 54, 40, tzinfo=timezone.utc) req = factories.FoiRequestFactory.create(site=site, secret_address="*****@*****.**", first_message=date, last_message=date) factories.FoiMessageFactory.create(request=req, timestamp=date)
def setUp(self): self.site = factories.make_world() self.admin_site = AdminSite() self.user_admin = UserAdmin(User, self.admin_site) self.factory = RequestFactory() self.user = User.objects.get(username='******') self.user.is_superuser = True
def setUp(self): self.secret_address = '*****@*****.**' self.site = factories.make_world() self.req = factories.FoiRequestFactory.create( site=self.site, secret_address=self.secret_address, closed=True) factories.FoiMessageFactory.create(request=self.req) factories.FoiMessageFactory.create(request=self.req, is_response=True)
def setUp(self): self.site = factories.make_world() self.req = factories.FoiRequestFactory.create( site=self.site, secret_address="*****@*****.**") self.other_req = factories.FoiRequestFactory.create( site=self.site, secret_address="*****@*****.**") factories.FoiMessageFactory.create(request=self.req)
def setUp(self): self.site = factories.make_world() self.req = factories.FoiRequestFactory.create(site=self.site, secret_address="*****@*****.**") self.other_req = factories.FoiRequestFactory.create(site=self.site, secret_address="*****@*****.**") factories.FoiMessageFactory.create(request=self.req)
def setUp(self): self.secret_address = '*****@*****.**' self.site = factories.make_world() self.req = factories.FoiRequestFactory.create(site=self.site, secret_address=self.secret_address) factories.FoiMessageFactory.create( timestamp=timezone.now().replace(2012, 1, 1), request=self.req, recipient_email='*****@*****.**')
def setUp(self): factories.make_world() self.test_user = User.objects.get(username='******') self.dev_user = User.objects.create_user("*****@*****.**", "dev_user", "123456") self.application = Application.objects.create( name="Test Application", redirect_uris="http://localhost http://example.com http://example.org", user=self.dev_user, client_type=Application.CLIENT_CONFIDENTIAL, authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE, ) self.access_token = AccessToken.objects.create( user=self.test_user, scope="read:user", expires=timezone.now() + timedelta(seconds=300), token="secret-access-token-key", application=self.application ) self.req = factories.FoiRequestFactory.create( visibility=FoiRequest.VISIBLE_TO_REQUESTER, user=self.test_user, title='permissions required' ) self.mes = factories.FoiMessageFactory.create( request=self.req ) self.att = factories.FoiAttachmentFactory.create( belongs_to=self.mes, approved=False ) self.att2 = factories.FoiAttachmentFactory.create( belongs_to=self.mes, approved=True ) factories.FoiRequestFactory.create( visibility=FoiRequest.VISIBLE_TO_REQUESTER, user=self.dev_user, title='never shown' ) self.pb = PublicBody.objects.all()[0] self.request_list_url = reverse('api:request-list') self.message_detail_url = reverse('api:message-detail', kwargs={'pk': self.mes.pk})
def setUp(self): self.site = factories.make_world() self.admin_site = AdminSite() self.request_admin = FoiRequestAdmin(FoiRequest, self.admin_site) self.attachment_admin = FoiAttachmentAdmin(FoiAttachment, self.admin_site) self.factory = RequestFactory() self.user = User.objects.get(username='******') self.user.is_superuser = True
def setUp(self): factories.make_world() self.test_user = User.objects.get(username='******') self.dev_user = User.objects.create_user("*****@*****.**", "dev_user", "123456") self.application = Application.objects.create( name="Test Application", redirect_uris="http://localhost http://example.com http://example.org", user=self.dev_user, client_type=Application.CLIENT_CONFIDENTIAL, authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE, ) self.access_token = AccessToken.objects.create( user=self.test_user, scope="read:user", expires=timezone.now() + timedelta(seconds=300), token="secret-access-token-key", application=self.application ) self.profile_url = reverse('api-user-profile')
def setUp(self): factories.make_world() self.user = factories.UserFactory.create() self.owner_team = TeamFactory.create() TeamMembershipFactory.create(user=self.user, team=self.owner_team, role=TeamMembership.ROLE_OWNER) TeamMembershipFactory.create(team=self.owner_team, role=TeamMembership.ROLE_OWNER) self.editor_team = TeamFactory.create() TeamMembershipFactory.create(user=self.user, team=self.editor_team, role=TeamMembership.ROLE_EDITOR) TeamMembershipFactory.create(team=self.editor_team, role=TeamMembership.ROLE_OWNER) self.other_team = TeamFactory.create() TeamMembershipFactory.create(team=self.other_team, role=TeamMembership.ROLE_EDITOR) TeamMembershipFactory.create(team=self.other_team, role=TeamMembership.ROLE_OWNER)
def setUp(self): factories.make_world() self.test_user = User.objects.get(username='******') self.dev_user = User.objects.create_user("*****@*****.**", "dev_user", "123456") self.application = Application.objects.create( name="Test Application", redirect_uris= "http://localhost http://example.com http://example.org", user=self.dev_user, client_type=Application.CLIENT_CONFIDENTIAL, authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE, ) self.access_token = AccessToken.objects.create( user=self.test_user, scope="read:user", expires=timezone.now() + timedelta(seconds=300), token="secret-access-token-key", application=self.application) self.profile_url = reverse('api-user-profile')
def setUp(self): factories.make_world()
def setUp(self): self.site = factories.make_world()
def setUp(self): self.secret_address = '*****@*****.**' self.site = factories.make_world() date = datetime(2010, 6, 5, 5, 54, 40, tzinfo=timezone.utc) req = factories.FoiRequestFactory.create( site=self.site, secret_address=self.secret_address, first_message=date, last_message=date) factories.FoiMessageFactory.create(request=req, timestamp=date) self.post_data = { "From": "*****@*****.**", "FromFull": { "Email": "*****@*****.**", "Name": "John Doe" }, "To": self.secret_address, "ToFull": [{ "Email": self.secret_address, "Name": "" }], "Cc": "\"Full name\" <*****@*****.**>, \"Another Cc\" <*****@*****.**>", "CcFull": [{ "Email": "*****@*****.**", "Name": "Full name" }, { "Email": "*****@*****.**", "Name": "Another Cc" }], "ReplyTo": "*****@*****.**", "Subject": "This is an inbound message", "MessageID": "22c74902-a0c1-4511-804f2-341342852c90", "Date": "Thu, 5 Apr 2012 16:59:01 +0200", "MailboxHash": "ahoy", "TextBody": "[ASCII]", "HtmlBody": "[HTML(encoded)]", "Tag": "", "Headers": [{ "Name": "X-Spam-Checker-Version", "Value": "SpamAssassin 3.3.1 (2010-03-16) onrs-ord-pm-inbound1.wildbit.com" }, { "Name": "X-Spam-Status", "Value": "No" }, { "Name": "X-Spam-Score", "Value": "-0.1" }, { "Name": "X-Spam-Tests", "Value": "DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_PASS" }, { "Name": "Received-SPF", "Value": "Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.160.180; helo=mail-gy0-f180.google.com; [email protected]; receiver=451d9b70cf9364d23ff6f9d51d870251569e+ahoy@inbound.postmarkapp.com" }, { "Name": "DKIM-Signature", "Value": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=wildbit.com; s=google; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; bh=cYr/+oQiklaYbBJOQU3CdAnyhCTuvemrU36WT7cPNt0=; b=QsegXXbTbC4CMirl7A3VjDHyXbEsbCUTPL5vEHa7hNkkUTxXOK+dQA0JwgBHq5C+1u iuAJMz+SNBoTqEDqte2ckDvG2SeFR+Edip10p80TFGLp5RucaYvkwJTyuwsA7xd78NKT Q9ou6L1hgy/MbKChnp2kxHOtYNOrrszY3JfQM=" }, { "Name": "MIME-Version", "Value": "1.0" }, { "Name": "Message-ID", "Value": "<*****@*****.**>" }], "Attachments": [{ "Name": "myimage.png", "Content": "[BASE64-ENCODED CONTENT]", "ContentType": "image/png", "ContentLength": 4096, "ContentID": "[email protected]" }, { "Name": "mypaper.doc", "Content": "[BASE64-ENCODED CONTENT]", "ContentType": "application/msword", "ContentLength": 16384, "ContentID": "" }] }
def setUp(self): factories.make_world() factories.rebuild_index() self.user = User.objects.get(username='******') self.pb = PublicBody.objects.all()[0]
def setUp(self): factories.make_world() self.pb = PublicBody.objects.all()[0]
def setUp(self): factories.make_world() factories.rebuild_index() self.do_logout() self.user = User.objects.all()[0] self.pb = PublicBody.objects.all()[0]
def setUp(self): self.site = make_world() translation.activate(settings.LANGUAGE_CODE)
def setUp(self): self.site = factories.make_world() date = datetime(2010, 6, 5, 5, 54, 40, tzinfo=timezone.utc) req = factories.FoiRequestFactory.create(site=self.site, secret_address="*****@*****.**", first_message=date, last_message=date) factories.FoiMessageFactory.create(request=req, timestamp=date) self.post_data = { "From": "*****@*****.**", "FromFull": { "Email": "*****@*****.**", "Name": "John Doe" }, "To": "*****@*****.**", "ToFull": [ { "Email": "*****@*****.**", "Name": "" } ], "Cc": "\"Full name\" <*****@*****.**>, \"Another Cc\" <*****@*****.**>", "CcFull": [ { "Email": "*****@*****.**", "Name": "Full name" }, { "Email": "*****@*****.**", "Name": "Another Cc" } ], "ReplyTo": "*****@*****.**", "Subject": "This is an inbound message", "MessageID": "22c74902-a0c1-4511-804f2-341342852c90", "Date": "Thu, 5 Apr 2012 16:59:01 +0200", "MailboxHash": "ahoy", "TextBody": "[ASCII]", "HtmlBody": "[HTML(encoded)]", "Tag": "", "Headers": [ { "Name": "X-Spam-Checker-Version", "Value": "SpamAssassin 3.3.1 (2010-03-16) onrs-ord-pm-inbound1.wildbit.com" }, { "Name": "X-Spam-Status", "Value": "No" }, { "Name": "X-Spam-Score", "Value": "-0.1" }, { "Name": "X-Spam-Tests", "Value": "DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_PASS" }, { "Name": "Received-SPF", "Value": "Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.160.180; helo=mail-gy0-f180.google.com; [email protected]; receiver=451d9b70cf9364d23ff6f9d51d870251569e+ahoy@inbound.postmarkapp.com" }, { "Name": "DKIM-Signature", "Value": "v=1; a=rsa-sha256; c=relaxed\/relaxed; d=wildbit.com; s=google; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; bh=cYr\/+oQiklaYbBJOQU3CdAnyhCTuvemrU36WT7cPNt0=; b=QsegXXbTbC4CMirl7A3VjDHyXbEsbCUTPL5vEHa7hNkkUTxXOK+dQA0JwgBHq5C+1u iuAJMz+SNBoTqEDqte2ckDvG2SeFR+Edip10p80TFGLp5RucaYvkwJTyuwsA7xd78NKT Q9ou6L1hgy\/MbKChnp2kxHOtYNOrrszY3JfQM=" }, { "Name": "MIME-Version", "Value": "1.0" }, { "Name": "Message-ID", "Value": "<*****@*****.**>" } ], "Attachments": [ { "Name": "myimage.png", "Content": "[BASE64-ENCODED CONTENT]", "ContentType": "image/png", "ContentLength": 4096, "ContentID": "[email protected]" }, { "Name": "mypaper.doc", "Content": "[BASE64-ENCODED CONTENT]", "ContentType": "application/msword", "ContentLength": 16384, "ContentID": "" } ] }
def setUp(self): clear_lru_caches() self.site = factories.make_world()