Commit 9ea070d3 authored by Tarsvini's avatar Tarsvini

updated lab_7

parent f80ae4f0
Pipeline #14774292 failed with stages
in 3 minutes and 40 seconds
No preview for this file type
......@@ -35,13 +35,13 @@
$.each(list, function(index, friend) {
var button = '<span class="pull-right">'+
'<button type="button" class="btn btn-xs btn-danger"'+
'onClick="deleteFriend('+friend.fields.npm+')">'+
'onClick=deleteFriend("'+friend.fields.npm+'")>'+
'&times;'+
'</button>'+
'</span>';
var detail = '<span class="col-xs-4 col-md-2 pull-right">'+
'<button type="button" class="btn btn-xs btn-default btn-block"'+
'onClick="description('+friend.fields.npm+')">'+
'onClick=description("'+friend.fields.npm+'")>'+
'detail'+
'</button>'+
'</span>';
......
......@@ -91,10 +91,11 @@ def validate_npm(request):
return JsonResponse(data)
def friend_description(request, npm):
friend = Friend.objects.filter(npm=npm)[0]
response['friend'] = friend;
html = 'description.html'
return render(request, html, response)
friend = Friend.objects.filter(npm__iexact=npm)[0]
response['friend'] = friend;
html = 'lab_7/description.html'
return render(request, html, response)
def model_to_dict(obj):
data = serializers.serialize('json', [obj,])
......
from django.test import TestCase
from django.test import Client
frm django.urls import resolve
# Create your tests here.
class lab9Test(TestCase):
def test_lab_9_url_is_exist(self):
response = Client().get('/lab-9/')
self.assertEqual(response.status_code,200)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment