desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Test index page with login at /documents/'
| def test_index_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('document_index'))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/documents/'
| def test_index_documents_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('index_documents'))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/files/'
| def test_index_files_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('index_files'))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/weblinks/'
| def test_index_weblinks_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('index_weblinks'))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/folder/add/'
| def test_folder_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_folder_add'))
self.assertEquals(response.status_code, 200)
self.assertEqual(Folder.objects.count(), 1)
post_dat... |
'Test index page with login at /documents/folder/view/<folder_id>'
| def test_folder_view_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_folder_view', args=[self.folder.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/folder/edit/<folder_id>'
| def test_folder_edit_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_folder_edit', args=[self.folder.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/folder/delete/<folder_id>'
| def test_folder_delete_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_folder_delete', args=[self.folder.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/add'
| def test_document_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_document_add'))
self.assertEquals(response.status_code, 200)
self.assertEqual(Document.objects.count(), 1)
resp... |
'Test index page with login at /documents/add/folder/<folder_id>'
| def test_document_add_typed(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_document_add_typed', args=[self.folder.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/view/<document_id>'
| def test_document_view_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_document_view', args=[self.document.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/edit/<document_id>'
| def test_document_edit_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_document_edit', args=[self.document.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/delete/<document_id>'
| def test_document_delete_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_document_delete', args=[self.document.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /file/view/<file_id>'
| def test_file_view_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_file_view', args=[self.file.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /file/edit/<file_id>'
| def test_file_edit_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_file_edit', args=[self.file.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /file/view/<file_id>'
| def test_file_delete_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_file_delete', args=[self.file.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/weblink/add/<folder_id>'
| def test_weblink_add_typed(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_weblink_add_typed', args=[self.folder.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/weblink/add/'
| def test_weblink_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_weblink_add'))
self.assertEquals(response.status_code, 200)
self.assertEqual(WebLink.objects.count(), 1)
respon... |
'Test index page with login at /documents/view/<weblink_id>'
| def test_weblink_view_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_weblink_view', args=[self.link.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/edit/<weblink_id>'
| def test_weblink_edit_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_weblink_edit', args=[self.link.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /documents/delete/<weblink_id>'
| def test_weblink_delete_login(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('documents_weblink_delete', args=[self.link.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page at /documents/'
| def test_index(self):
| response = self.client.get('/documents/')
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/documents/'
| def test_index_documents_out(self):
| response = self.client.get(reverse('index_documents'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/files/'
| def test_index_files_out(self):
| response = self.client.get(reverse('index_files'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/weblinks/'
| def test_index_weblinks_out(self):
| response = self.client.get(reverse('index_weblinks'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/folder/add/'
| def test_folder_add_out(self):
| response = self.client.get(reverse('documents_folder_add'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/folder/view/<folder_id>'
| def test_folder_view_out(self):
| response = self.client.get(reverse('documents_folder_view', args=[self.folder.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/folder/edit/<folder_id>'
| def test_folder_edit_out(self):
| response = self.client.get(reverse('documents_folder_edit', args=[self.folder.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/folder/delete/<folder_id>'
| def test_folder_delete_out(self):
| response = self.client.get(reverse('documents_folder_delete', args=[self.folder.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/add'
| def test_document_add_out(self):
| response = self.client.get(reverse('documents_document_add'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/add/folder/<folder_id>'
| def test_document_add_typed_out(self):
| response = self.client.get(reverse('documents_document_add_typed', args=[self.folder.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/view/<document_id>'
| def test_document_view_out(self):
| response = self.client.get(reverse('documents_document_view', args=[self.document.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/edit/<document_id>'
| def test_document_edit_out(self):
| response = self.client.get(reverse('documents_document_edit', args=[self.document.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/delete/<document_id>'
| def test_document_delete_out(self):
| response = self.client.get(reverse('documents_document_delete', args=[self.document.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /file/view/<file_id>'
| def test_file_view_out(self):
| response = self.client.get(reverse('documents_file_view', args=[self.file.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /file/edit/<file_id>'
| def test_file_edit_out(self):
| response = self.client.get(reverse('documents_file_edit', args=[self.file.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /file/view/<file_id>'
| def test_file_delete_out(self):
| response = self.client.get(reverse('documents_file_delete', args=[self.file.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/weblink/add/<folder_id>'
| def test_weblink_add_typed_out(self):
| response = self.client.get(reverse('documents_weblink_add_typed', args=[self.folder.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/weblink/add/'
| def test_weblink_add_out(self):
| response = self.client.get(reverse('documents_weblink_add'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/view/<weblink_id>'
| def test_weblink_view_out(self):
| response = self.client.get(reverse('documents_weblink_view', args=[self.link.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/edit/<weblink_id>'
| def test_weblink_edit_out(self):
| response = self.client.get(reverse('documents_weblink_edit', args=[self.link.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /documents/delete/<weblink_id>'
| def test_weblink_delete_out(self):
| response = self.client.get(reverse('documents_weblink_delete', args=[self.link.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Process form'
| def save(self, *args, **kwargs):
| if self.instance:
if self.is_valid():
if self.cleaned_data['delete']:
if (self.cleaned_data['delete'] == 'delete'):
self.instance.delete()
if (self.cleaned_data['delete'] == 'trash'):
self.instance.trash = True
... |
'Initial Setup'
| def setUp(self):
| if (not self.prepared):
Object.objects.all().delete()
User.objects.all().delete()
try:
self.group = Group.objects.get(name='test')
except Group.DoesNotExist:
Group.objects.all().delete()
self.group = Group(name='test')
self.group.save()... |
'Test index page at /sales/statuses'
| def test_unauthenticated_access(self):
| response = self.client.get('/api/sales/statuses')
self.assertEquals(response.status_code, 401)
|
'Test index page api/sales/status'
| def test_get_statuses_list(self):
| response = self.client.get(path=reverse('api_sales_status'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/sales/products'
| def test_get_products_list(self):
| response = self.client.get(path=reverse('api_sales_products'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/sales/sources'
| def test_get_sources_list(self):
| response = self.client.get(path=reverse('api_sales_sources'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/sales/leads'
| def test_get_leads_list(self):
| response = self.client.get(path=reverse('api_sales_leads'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/sales/opportunities'
| def test_get_opportunities_list(self):
| response = self.client.get(path=reverse('api_sales_opportunities'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/sales/orders'
| def test_get_orders_list(self):
| response = self.client.get(path=reverse('api_sales_orders'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/sales/subscriptions'
| def test_get_subscriptions_list(self):
| response = self.client.get(path=reverse('api_sales_subscriptions'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_status_view', args=[self.id])
except Exception:
return ''
|
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_product_view', args=[self.id])
except:
return ''
|
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_source_view', args=[self.id])
except Exception:
return ''
|
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_lead_view', args=[self.id])
except Exception:
return ''
|
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_opportunity_view', args=[self.id])
except Exception:
return ''
|
'Fulfil'
| def fulfil(self):
| for p in self.orderedproduct_set.all():
if (not p.fulfilled):
product = p.product
product.stock_quantity -= p.quantity
product.save()
p.fulfilled = True
p.save()
if p.subscription:
p.subscription.renew()
|
'Automatically set order reference'
| def save(self, *args, **kwargs):
| super(SaleOrder, self).save(*args, **kwargs)
try:
conf = ModuleSetting.get_for_module('treeio.sales', 'order_fulfil_status')[0]
fulfil_status = long(conf.value)
if (self.status.id == fulfil_status):
self.fulfil()
except Exception:
pass
|
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_order_view', args=[self.id])
except Exception:
return ''
|
'Get the cycle start date'
| def get_cycle_start(self):
| if (not self.cycle_end):
return None
cycle_end = self.cycle_end
if (self.cycle_period == 'monthly'):
p = relativedelta(months=(+ 1))
elif (self.cycle_period == 'weekly'):
p = timedelta(weeks=1)
elif (self.cycle_period == 'daily'):
p = timedelta(days=1)
elif (self.... |
'Renew'
| def renew(self):
| if (self.cycle_period == 'monthly'):
p = relativedelta(months=(+ 1))
elif (self.cycle_period == 'daily'):
p = timedelta(days=1)
elif (self.cycle_period == 'weekly'):
p = timedelta(weeks=1)
elif (self.cycle_period == 'quarterly'):
p = relativedelta(months=(+ 4))
elif (... |
'Activate'
| def activate(self):
| if self.active:
return
self.renew()
self.active = True
self.save()
|
'Deactivate'
| def deactivate(self):
| if (not self.active):
return
self.active = False
self.save()
|
'Create a new sale order for self'
| def invoice(self):
| new_invoice = SaleOrder()
try:
conf = ModuleSetting.get_for_module('treeio.sales', 'default_order_status')[0]
new_invoice.status = long(conf.value)
except Exception:
ss = SaleStatus.objects.all()[0]
new_invoice.status = ss
so = SaleSource.objects.all()[0]
new_invoice.... |
'Checks and sets the state of the subscription'
| def check_status(self):
| if (not self.active):
return 'Inactive'
if self.expiry:
if (datetime.now() > datetime.combine(self.expiry, time.min)):
self.deactivate()
return 'Expired'
if (not self.cycle_end):
self.renew()
cycle_end = self.cycle_end
if (datetime.now().date() >= cycl... |
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_subscription_view', args=[self.id])
except Exception:
return ''
|
'Returns absolute URL'
| def get_absolute_url(self):
| try:
return reverse('sales_ordered_view', args=[self.id])
except Exception:
return ''
|
'Returns total sum for this item'
| def get_total(self):
| total = (self.rate * self.quantity)
if self.discount:
total = (total - ((total * self.discount) / 100))
if (total < 0):
total = Decimal(0)
return total.quantize(Decimal('.01'), rounding=ROUND_UP)
|
'Returns total sum for this item in the display currency'
| def get_total_display(self):
| total = (self.rate_display * self.quantity)
if self.discount:
total = (total - ((total * self.discount) / 100))
if (total < 0):
total = Decimal(0)
return total.quantize(Decimal('.01'), rounding=ROUND_UP)
|
'Add currencies to financial items'
| def forwards(self, orm):
| try:
currency = Currency.objects.get(is_default=True)
except:
currency = Currency.objects.create()
currency.code = 'USD'
currency.name = 'USD United States of America, Dollars'
currency.symbol = u'$'
currency.is_default = True
currency.s... |
'Initial Setup'
| def setUp(self):
| if (not self.prepared):
(self.group, created) = Group.objects.get_or_create(name='test')
(duser, created) = DjangoUser.objects.get_or_create(username=self.username)
duser.set_password(self.password)
duser.save()
(self.user, created) = User.objects.get_or_create(user=duser)
... |
'Test page with login at /sales/index'
| def test_index(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_index'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/open'
| def test_index_open(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_index_open'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/index/assigned'
| def test_index_assigned(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_index_assigned'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/order/add'
| def test_order_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_order_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/order/add/lead/'
| def test_order_add_lead(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_order_add_with_lead', args=[self.lead.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/order/add/opportunity/'
| def test_order_add_opportunity(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_order_add_with_opportunity', args=[self.opportunity.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/order/edit/'
| def test_order_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_order_edit', args=[self.order.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/order/view/'
| def test_order_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_order_view', args=[self.order.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/order/delete/'
| def test_order_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_order_delete', args=[self.order.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/order/invoice/'
| def test_order_invoice_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_order_invoice_view', args=[self.order.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/product/index'
| def test_product_index(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_product_index'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/product/add/'
| def test_product_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_product_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/product/add'
| def test_product_add_parent(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_product_add', args=[self.product.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/product/edit/'
| def test_product_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_product_edit', args=[self.product.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/product/view/'
| def test_product_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_product_view', args=[self.product.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/product/delete/'
| def test_product_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_product_delete', args=[self.product.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/settings/view'
| def test_settings_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_settings_view'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/settings/edit'
| def test_settings_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_settings_edit'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/status/add'
| def test_status_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_status_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/status/edit/'
| def test_status_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_status_edit', args=[self.status.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/status/view/'
| def test_status_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_status_view', args=[self.status.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/status/delete/'
| def test_status_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_status_delete', args=[self.status.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/subscription/add'
| def test_subscription_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_subscription_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/subscription/add/'
| def test_subscription_add_product(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_subscription_add_with_product', args=[self.product.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/subscription/edit/'
| def test_subscription_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_subscription_edit', args=[self.subscription.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/subscription/view/'
| def test_subscription_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_subscription_view', args=[self.subscription.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/subscription/delete/'
| def test_subscription_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_subscription_delete', args=[self.subscription.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /sales/ordered_product/add/'
| def test_ordered_product_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('sales_ordered_product_add', args=[self.order.id]))
self.assertEquals(response.status_code, 200)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.