Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
# feincms page containing zipfelchappe app content
self.page = Page.objects.create(title='Projects', slug='projects', override_url='/')
ct = self.page.content_type_for(ApplicationContent)
ct.objects.create(parent=self.page, urlconf_path=app_settings.ROOT_URLS)
self.project = ProjectFactory.create()
self.p1 = PledgeFactory.create(
project=self.project,
amount=10,
provider='postfinance'
)
self.user = UserFactory.create(
first_name='Hans',
last_name='Muster'
)
self.p1.backer.user = self.user
self.p1.backer.save()
self.client = self.get_client_with_session()
def setUp(self):
# feincms page containing zipfelchappe app content
self.page = Page.objects.create(title='Projects', slug='projects')
ct = self.page.content_type_for(ApplicationContent)
ct.objects.create(parent=self.page, urlconf_path=app_settings.ROOT_URLS)
# Fixture Data for following tests
self.project1 = ProjectFactory.create()
self.project2 = ProjectFactory.create()
self.user = UserFactory.create()
self.admin = UserFactory.create(is_superuser=True, is_staff=True)
self.reward = RewardFactory.create(
project=self.project1,
minimum=20.00,
quantity=1
)
# Fresh Client for every test
self.client = Client()
ordering=3,
title="Please call me",
name="please-call-me",
type="checkbox",
is_required=False,
)
form_class = form.form_class()
form_instance = form_class()
self.assertListEqual(
[field.name for field in form_instance],
["subject", "email", "body", "please-call-me"],
)
page = Page.objects.create(override_url="/", title="")
page.formcontent_set.create(
region="main",
ordering=0,
form=form,
success_message="Thanks, we will get back to you",
)
response = self.client.get("/")
self.assertContains(response, 'method="post"', 1)
self.assertContains(response, 'action="#form{0}"'.format(form.id), 1)
self.assertContains(
response,
"
def setUp(self):
# feincms page containing zipfelchappe app content
self.page = Page.objects.create(title='Projects', slug='projects', override_url='/')
ct = self.page.content_type_for(ApplicationContent)
ct.objects.create(parent=self.page, urlconf_path=app_settings.ROOT_URLS)
self.project = ProjectFactory.create()
self.p1 = PledgeFactory.create(
project=self.project,
amount=10,
provider='postfinance'
)
self.user = UserFactory.create(
first_name='Hans',
last_name='Muster'
)
self.p1.backer.user = self.user
self.p1.backer.save()
self.client = self.get_client_with_session()
def setUp(self):
# feincms page containing zipfelchappe app content
self.page = Page.objects.create(title='Projects', slug='projects')
ct = self.page.content_type_for(ApplicationContent)
ct.objects.create(parent=self.page, urlconf_path=app_settings.ROOT_URLS)
# Fixture Data for following tests
self.project1 = ProjectFactory.create()
self.project2 = ProjectFactory.create()
self.user = UserFactory.create()
self.reward = RewardFactory.create(
project=self.project1,
minimum=20.00,
quantity=1
)
# Fresh Client for every test
self.client = Client()
def handle_noargs(self, **options):
parents = [None] * 5
Page.objects.all().delete()
for i1 in range(5):
parents[0] = Page.objects.create(
title='Page %s' % (i1,),
)
for i2 in range(5):
parents[1] = Page.objects.create(
title='Page %s.%s' % (i1, i2),
parent=parents[0],
)
for i3 in range(5):
parents[2] = Page.objects.create(
title='Page %s.%s.%s' % (i1, i2, i3),
parent=parents[1],
)
for i4 in range(5):
parents[3] = Page.objects.create(
title='Page %s.%s.%s.%s' % (i1, i2, i3, i4),
parent=parents[2],
)