2016-12-06 19:38:43 +00:00
|
|
|
from urllib.request import urlopen
|
|
|
|
|
Fixed #2879 -- Added support for the integration with Selenium and other in-browser testing frameworks. Also added the first Selenium tests for `contrib.admin`. Many thanks to everyone for their contributions and feedback: Mikeal Rogers, Dirk Datzert, mir, Simon G., Almad, Russell Keith-Magee, Denis Golomazov, devin, robertrv, andrewbadr, Idan Gazit, voidspace, Tom Christie, hjwp2, Adam Nelson, Jannis Leidel, Anssi Kääriäinen, Preston Holmes, Bruno Renié and Jacob Kaplan-Moss.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-22 08:33:58 +00:00
|
|
|
from django.http import HttpResponse
|
2015-01-28 12:35:27 +00:00
|
|
|
|
Fixed #2879 -- Added support for the integration with Selenium and other in-browser testing frameworks. Also added the first Selenium tests for `contrib.admin`. Many thanks to everyone for their contributions and feedback: Mikeal Rogers, Dirk Datzert, mir, Simon G., Almad, Russell Keith-Magee, Denis Golomazov, devin, robertrv, andrewbadr, Idan Gazit, voidspace, Tom Christie, hjwp2, Adam Nelson, Jannis Leidel, Anssi Kääriäinen, Preston Holmes, Bruno Renié and Jacob Kaplan-Moss.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-22 08:33:58 +00:00
|
|
|
from .models import Person
|
|
|
|
|
|
|
|
|
|
|
|
def example_view(request):
|
|
|
|
return HttpResponse('example view')
|
|
|
|
|
|
|
|
|
|
|
|
def model_view(request):
|
|
|
|
people = Person.objects.all()
|
2013-08-29 23:20:00 +00:00
|
|
|
return HttpResponse('\n'.join(person.name for person in people))
|
Fixed #2879 -- Added support for the integration with Selenium and other in-browser testing frameworks. Also added the first Selenium tests for `contrib.admin`. Many thanks to everyone for their contributions and feedback: Mikeal Rogers, Dirk Datzert, mir, Simon G., Almad, Russell Keith-Magee, Denis Golomazov, devin, robertrv, andrewbadr, Idan Gazit, voidspace, Tom Christie, hjwp2, Adam Nelson, Jannis Leidel, Anssi Kääriäinen, Preston Holmes, Bruno Renié and Jacob Kaplan-Moss.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-12-22 08:33:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
def create_model_instance(request):
|
|
|
|
person = Person(name='emily')
|
|
|
|
person.save()
|
2012-10-20 10:34:50 +00:00
|
|
|
return HttpResponse('')
|
|
|
|
|
|
|
|
|
|
|
|
def environ_view(request):
|
2013-08-29 23:20:00 +00:00
|
|
|
return HttpResponse("\n".join("%s: %r" % (k, v) for k, v in request.environ.items()))
|
2016-12-06 19:38:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
def subview(request):
|
|
|
|
return HttpResponse('subview')
|
|
|
|
|
|
|
|
|
|
|
|
def subview_calling_view(request):
|
|
|
|
response = urlopen(request.GET['url'] + '/subview/')
|
|
|
|
return HttpResponse('subview calling view: {}'.format(response.read().decode()))
|
|
|
|
|
|
|
|
|
|
|
|
def check_model_instance_from_subview(request):
|
|
|
|
urlopen(request.GET['url'] + '/create_model_instance/')
|
|
|
|
response = urlopen(request.GET['url'] + '/model_view/')
|
|
|
|
return HttpResponse('subview calling view: {}'.format(response.read().decode()))
|