desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Test page with login at /contacts/field/add'
| def test_contact_field_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_field_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/field/view/(?P<field_id>\d+)'
| def test_contact_field_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_field_view', args=[self.field.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/field/edit/(?P<field_id>\d+)'
| def test_contact_field_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_field_edit', args=[self.field.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/field/delete/(?P<field_id>\d+)'
| def test_contact_field_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_field_delete', args=[self.field.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/contact/add/'
| def test_contact_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_contact_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/contact/add/<type_id>/'
| def test_contact_add_by_type(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_contact_add_typed', args=[self.contact_type.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/me/'
| def test_contact_me(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_contact_me'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/contact/view/<contact_id>/'
| def test_contact_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_contact_view', args=[self.contact.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/contact/edit/<contact_id>/'
| def test_contact_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_contact_edit', args=[self.contact.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /contacts/contact/delete/<contact_id>/'
| def test_contact_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_contact_delete', args=[self.contact.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /contacts/settings/view/'
| def test_contact_settings_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('identities_settings_view'))
self.assertEquals(response.status_code, 200)
|
'Test index page at /contacts/'
| def test_index(self):
| response = self.client.get('/contacts/')
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/users/'
| def test_contact_users_out(self):
| response = self.client.get(reverse('identities_index_users'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/groups/'
| def test_contact_groups_out(self):
| response = self.client.get(reverse('identities_index_groups'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/types/add/'
| def test_contact_type_add_out(self):
| response = self.client.get(reverse('identities_type_add'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/type/view/(?P<type_id>\d+)'
| def test_contact_type_view_out(self):
| response = self.client.get(reverse('identities_type_view', args=[self.contact_type.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/type/edit/(?P<type_id>\d+)'
| def test_contact_type_edit_out(self):
| response = self.client.get(reverse('identities_type_edit', args=[self.contact_type.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/type/delete/(?P<type_id>\d+)'
| def test_contact_type_delete_out(self):
| response = self.client.get(reverse('identities_type_delete', args=[self.contact_type.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/field/add'
| def test_contact_field_add_out(self):
| response = self.client.get(reverse('identities_field_add'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/field/view/(?P<field_id>\d+)'
| def test_contact_field_view_out(self):
| response = self.client.get(reverse('identities_field_view', args=[self.field.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/field/edit/(?P<field_id>\d+)'
| def test_contact_field_edit_out(self):
| response = self.client.get(reverse('identities_field_edit', args=[self.field.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/field/delete/(?P<field_id>\d+)'
| def test_contact_field_delete_out(self):
| response = self.client.get(reverse('identities_field_delete', args=[self.field.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/contact/add/'
| def test_contact_add_out(self):
| response = self.client.get(reverse('identities_contact_add'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/contact/add/<type_id>/'
| def test_contact_add_by_type_out(self):
| response = self.client.get(reverse('identities_contact_add_typed', args=[self.contact_type.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/me/'
| def test_contact_me_out(self):
| response = self.client.get(reverse('identities_contact_me'))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/contact/view/<contact_id>/'
| def test_contact_view_out(self):
| response = self.client.get(reverse('identities_contact_view', args=[self.contact.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/contact/edit/<contact_id>/'
| def test_contact_edit_out(self):
| response = self.client.get(reverse('identities_contact_edit', args=[self.contact.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/contact/delete/<contact_id>/'
| def test_contact_delete_out(self):
| response = self.client.get(reverse('identities_contact_delete', args=[self.contact.id]))
self.assertRedirects(response, reverse('user_login'))
|
'Testing /contacts/settings/view/'
| def test_contact_settings_view_out(self):
| response = self.client.get(reverse('identities_settings_view'))
self.assertRedirects(response, reverse('user_login'))
|
'Import contacts from CSV file'
| def import_contacts(self, content):
| f = StringIO.StringIO(content)
contacts = csv.DictReader(f, delimiter=',')
self.parse_contacts(contacts)
|
'Verify email format'
| def verify_email(self, email):
| try:
email_matched = re.findall('[a-zA-Z0-9+_\\-\\.]+@[0-9a-zA-Z][.-0-9a-zA-Z]*.[a-zA-Z]+', email)
if email_matched:
return email
except Exception:
return None
|
'Verify url'
| def verify_url(self, url):
| if url:
if ('://' not in url):
url = (u'http://%s' % url)
url_fields = list(urlparse.urlsplit(url))
if (not url_fields[2]):
url_fields[2] = '/'
url = urlparse.urlunsplit(url_fields)
return url
|
'Break down CSV file into fields'
| def parse_contacts(self, contacts):
| for row in contacts:
try:
type = row['type']
except Exception:
pass
try:
name = row['name']
except Exception:
try:
firstname = row['firstname']
surname = row['surname']
name = ((firstname ... |
'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
... |
'Ensure the name of the field only contains alphanumeric'
| def clean_name(self):
| name = self.cleaned_data['name']
if (not re.match('^[a-zA-Z0-9-_]+$', name)):
raise forms.ValidationError(_('Sorry, field names can only contain letters, numbers, hyphens (-) and underscores (_)'))
return name
|
'Ensures a contact with the same name doesn\'t already exists'
| def clean_name(self):
| instance = getattr(self, 'instance', None)
name = self.cleaned_data['name']
if (instance and (not instance.id)):
slug = unicode(name).replace(' ', '-')
slug = defaultfilters.slugify(unidecode(slug))
if ContactType.objects.filter(slug=slug).exists():
raise forms.Validat... |
'Generate a Django-friendly field from Hardtree spec in DB'
| def _get_form_field(self, field, value=None):
| form_field = None
if (field.field_type == 'text'):
form_field = forms.CharField(label=field.label, max_length=512, widget=forms.TextInput(attrs={'size': '30'}))
elif (field.field_type == 'textarea'):
form_field = forms.CharField(label=field.label, widget=forms.Textarea(attrs={'class': 'no-ed... |
'Generate an available name for a field'
| def _get_free_field_name(self, field):
| num = 0
field_name = ((unicode(field.name) + u'___') + unicode(num))
while (field_name in self.fields):
num += 1
field_name = ((unicode(field.name) + u'___') + unicode(num))
return field_name
|
'Returns an upload_to path to a new file'
| def _get_upload_name(self, filename):
| import hashlib
import random
while True:
hasher = hashlib.md5()
hasher.update(str(random.random()))
filepath = (((u'identities/' + hasher.hexdigest()) + u'__') + filename)
fullpath = (settings.MEDIA_ROOT + filepath)
if (not default_storage.exists(fullpath)):
... |
'Process an uploaded file'
| def _handle_uploaded_file(self, field_name):
| try:
file = self.files[field_name]
filepath = self._get_upload_name(file.name)
except KeyError:
return ''
destination = open((settings.MEDIA_ROOT + filepath), 'wb+')
for chunk in file.chunks():
destination.write(chunk)
destination.close()
return (settings.MEDIA_UR... |
'Resizes Image if it\'s over the maximum dimension'
| def _image_resize(self, filepath):
| filepath = filepath.replace(settings.MEDIA_URL, '')
filepath = (settings.MEDIA_ROOT + filepath)
try:
img = Image.open(filepath)
expected_size = getattr(settings, 'HARDTREE_IMAGE_MAX_SIZE', [400, 300])
if ((img.size[0] > expected_size[0]) or (img.size[1] > expected_size[1])):
... |
'Populates form with fields from given ContactType'
| def __init__(self, user=None, contact_type=None, *args, **kwargs):
| if ('instance' in kwargs):
self.instance = kwargs['instance']
values = self.instance.contactvalue_set.all()
del kwargs['instance']
super(ContactForm, self).__init__(*args, **kwargs)
self.fields['parent'] = forms.ModelChoiceField(label='Parent', queryset=[], required=False)
self.f... |
'Process form and create DB objects as required'
| def save(self, request, contact_type=None):
| if self.instance:
contact = self.instance
else:
contact = Contact()
contact.contact_type = contact_type
contact.name = unicode(self.cleaned_data['name'])
if ('parent' in self.cleaned_data):
contact.parent = self.cleaned_data['parent']
if ('related_user' in self.cleane... |
'Sets choices and initial value'
| def __init__(self, user, *args, **kwargs):
| super(SettingsForm, self).__init__(*args, **kwargs)
self.fields['default_contact_type'].queryset = Object.filter_permitted(user, ContactType.objects)
try:
conf = ModuleSetting.get_for_module('treeio.identities', 'default_contact_type')[0]
default_task_status = ContactType.objects.get(pk=long... |
'Form processor'
| def save(self):
| try:
ModuleSetting.set_for_module('default_contact_type', self.cleaned_data['default_contact_type'].id, 'treeio.identities')
except Exception:
return False
|
'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 /api/services/services'
| def test_unauthenticated_access(self):
| response = self.client.get('/api/services/services')
self.assertEquals(response.status_code, 401)
|
'Test index page api/services/status'
| def test_get_ticket_statuses_list(self):
| response = self.client.get(path=reverse('api_services_status'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/services'
| def test_get_services_list(self):
| response = self.client.get(path=reverse('api_services'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/services/sla'
| def test_get_sla_list(self):
| response = self.client.get(path=reverse('api_services_sla'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/services/agents'
| def test_get_agents_list(self):
| response = self.client.get(path=reverse('api_services_agents'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/services/queues'
| def test_get_queues_list(self):
| response = self.client.get(path=reverse('api_services_queues'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/services/ticket/records/{ticket number}'
| def test_get_records(self):
| response = self.client.get(path=reverse('api_services_ticket_records', kwargs={'ticket_id': self.ticket.id}), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Test index page api/services/tasks'
| def test_get_tasks_list(self):
| response = self.client.get(path=reverse('api_services_tickets'), **self.authentication_headers)
self.assertEquals(response.status_code, 200)
|
'Run'
| def run(self):
| self.process_email()
|
'Send email'
| def send_email(self):
| self.start()
|
'Returns email of the original message author'
| def get_original_message_author_email(self):
| message = self.message
contact = message.author
email = ContactValue.objects.filter(field__field_type='email', contact=contact)
if email:
email = email[0]
return email
|
'Returns email of the reply message author'
| def get_reply_message_author_email(self):
| message = self.message
contact = message.reply_to.author
email = ContactValue.objects.filter(field__field_type='email', contact=contact)
if email:
email = email[0]
return email
|
'Process email'
| def process_email(self):
| message = self.message
if message.reply_to:
user = message.reply_to.author.related_user
original_author = self.get_original_message_author_email()
reply_author = self.get_reply_message_author_email()
if ((not user) and original_author):
if (message.stream.outgoing_ser... |
'Returns absolute URL of the object'
| def get_absolute_url(self):
| return reverse('services_status_view', args=[self.id])
|
'Returns absolute URL of the object'
| def get_absolute_url(self):
| try:
return reverse('services_service_view', args=[self.id])
except Exception:
return ''
|
'Returns absolute URL of the object'
| def get_absolute_url(self):
| try:
return reverse('services_sla_view', args=[self.id])
except Exception:
return ''
|
'Returns absolute URL of the object'
| def get_absolute_url(self):
| try:
return reverse('services_agent_view', args=[self.id])
except Exception:
return ''
|
'Returns absolute URL of the object'
| def get_absolute_url(self):
| try:
return reverse('services_queue_view', args=[self.id])
except Exception:
return ''
|
'Returns a Human-friendly priority name'
| def priority_human(self):
| choices = ((5, _('Highest')), (4, _('High')), (3, _('Normal')), (2, _('Low')), (1, _('Lowest')))
for choice in choices:
if (choice[0] == self.priority):
return choice[1]
|
'Returns a Human-friendly urgency name'
| def urgency_human(self):
| choices = ((5, _('Highest')), (4, _('High')), (3, _('Normal')), (2, _('Low')), (1, _('Lowest')))
for choice in choices:
if (choice[0] == self.priority):
return choice[1]
|
'Automatically set ticket reference and send message to caller'
| def save(self, *args, **kwargs):
| super(Ticket, self).save(*args, **kwargs)
if (not self.reference):
if self.queue:
self.reference = (self.queue.ticket_code + str(self.id))
else:
self.reference = str(self.id)
self.save()
|
'Returns absolute URL of the object'
| def get_absolute_url(self):
| try:
return reverse('services_ticket_view', args=[self.id])
except Exception:
return ''
|
'Migrate the UpdateRecords'
| def forwards(self, orm):
| for record in orm['services.TicketRecord'].objects.all():
update = orm['core.UpdateRecord'].objects.create()
update.author = record.creator
if (record.record_type == 'manual'):
update.record_type = 'manual'
else:
update.record_type = 'update'
update.bo... |
'Test Services models'
| def test_model(self):
| status = TicketStatus(name='TestStatus')
status.save()
self.assertNotEquals(status.id, None)
queue = TicketQueue(name='TestQueue', default_ticket_status=status)
queue.save()
self.assertNotEquals(status.id, None)
ticket = Ticket(name='TestTicket', status=status, queue=queue)
ticket.save()... |
'Initial Setup'
| def setUp(self):
| if (not self.prepared):
Object.objects.all().delete()
User.objects.all().delete()
(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(... |
'Test index page with login at /services/'
| 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('services'))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /services/owned'
| def test_index_owned(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_index_owned'))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /services/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('services_index_assigned'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/queue/add'
| def test_queue_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_queue_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/queue/view/<queue_id>'
| def test_queue_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_queue_view', args=[self.queue.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/queue/edit/<queue_id>'
| def test_queue_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_queue_edit', args=[self.queue.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/queue/delete/<queue_id>'
| def test_queue_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_queue_delete', args=[self.queue.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /services/status/view/<status_id>'
| 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('services_status_view', args=[self.status.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /services/status/edit/<status_id>'
| 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('services_status_edit', args=[self.status.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /services/status/delete/<status_id>'
| 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('services_status_delete', args=[self.status.id]))
self.assertEquals(response.status_code, 200)
|
'Test index page with login at /services/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('services_status_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/ticket/add'
| def test_ticket_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_ticket_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/ticket/add/queue/(?P<queue_id>\d+)'
| def test_ticket_add_by_queue(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_ticket_add_by_queue', args=[self.queue.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/ticket/view/<ticket_id>'
| def test_ticket_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_ticket_view', args=[self.ticket.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/ticket/edit/<ticket_id>'
| def test_ticket_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_ticket_edit', args=[self.ticket.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/ticket/delete/<ticket_id>'
| def test_ticket_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_ticket_delete', args=[self.ticket.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/ticket/set/(?P<ticket_id>\d+)/status/(?P<status_id>\d+)'
| def test_ticket_set_status(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_ticket_set_status', args=[self.ticket.id, self.status.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/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('services_settings_view'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/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('services_settings_view'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/catalogue'
| def test_service_catalogue(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_service_catalogue'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/service/view/<service_id>'
| def test_service_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_service_view', args=[self.service.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/service/edit/<service_id>'
| def test_service_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_service_edit', args=[self.service.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/service/delete/<service_id>'
| def test_service_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_service_delete', args=[self.service.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/service/add'
| def test_service_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_service_add'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/sla'
| def test_sla_index(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_sla_index'))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/sla/view/<sla_id>'
| def test_sla_view(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_sla_view', args=[self.sla.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/sla/edit/<sla_id>'
| def test_sla_edit(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_sla_edit', args=[self.sla.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/sla/delete/<sla_id>'
| def test_sla_delete(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_sla_delete', args=[self.sla.id]))
self.assertEquals(response.status_code, 200)
|
'Test page with login at /services/sla/add'
| def test_sla_add(self):
| response = self.client.post('/accounts/login', {'username': self.username, 'password': self.password})
self.assertRedirects(response, '/')
response = self.client.get(reverse('services_sla_index'))
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.