forked from harvard-lil/capstone
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request harvard-lil#17 from anastasia/develop
Develop
- Loading branch information
Showing
12 changed files
with
156 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# The CaseLaw Access Project API | ||
# The Caselaw Access Project API | ||
Please see here http://lil.law.harvard.edu/projects/caselaw-access-project for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% load static %} | ||
|
||
|
||
<html> | ||
<head> | ||
<title>Caselaw Access Project</title> | ||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> | ||
<link href='//fonts.googleapis.com/css?family=Rajdhani:400,300,500,700' rel='stylesheet' type='text/css'> | ||
|
||
</head> | ||
<body> | ||
<div> | ||
<header class="ftl-header"> | ||
<div class="ftl-header-content"> | ||
<a href="/"> | ||
<img class="ftl-logo" src="{% static "img/logo-small-blue.png" %}" alt="CAP Logo"></img> | ||
</a> | ||
<span class="ftl-text"> CASELAW ACCESS PROJECT</span> | ||
<a href="http://librarylab.law.harvard.edu" target="_blank"> | ||
<img class="lil-logo" src="{% static "img/LIL-logo.png" %}" alt="Library Innovation Lab"></img> | ||
</a> | ||
</div> | ||
<div class="border-gray"></div> | ||
</header> | ||
|
||
|
||
{% block content %}{% endblock content %} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{% extends "base.html" %} | ||
{% load rest_framework %} | ||
{% block branding %} | ||
<h3 style="margin: 0 0 20px;">My Site Name</h3> | ||
{% endblock %} | ||
<form class="form-inline" action="/account/login/" method="POST"> | ||
{% csrf_token %} | ||
{% render_form serializer template_pack='rest_framework/vertical' %} | ||
<button type="submit" class="btn btn-default">Sign in</button> | ||
</form> | ||
{% block content %} | ||
{% block branding %} | ||
<h3 style="margin: 0 0 20px;">Log in</h3> | ||
{% endblock %} | ||
<form class="form-inline" action="/accounts/view_details/" method="POST"> | ||
{% csrf_token %} | ||
{% render_form serializer template_pack='rest_framework/vertical' %} | ||
<button type="submit" class="btn btn-default">Sign in</button> | ||
</form> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
{% load rest_framework %} | ||
{% extends "base.html" %} | ||
{% block content %} | ||
{% load rest_framework %} | ||
|
||
<form class="form-inline" action="/account/register_user/" method="POST"> | ||
{% csrf_token %} | ||
{% render_form serializer template_pack='rest_framework/inline' %} | ||
<!-- <label>Confirm password</label> | ||
<input type='password' name='password_confirm'/> --> | ||
{% if errors %} | ||
{% for key,value in errors.items %} | ||
{{ key }} : {{ value }} | ||
{% endfor %} | ||
{% endif %} | ||
<button type="submit" class="btn btn-default">Sign up</button> | ||
</form> | ||
<form class="form-inline" action="/accounts/register_user/" method="POST"> | ||
{% csrf_token %} | ||
{% render_form serializer template_pack='rest_framework/inline' %} | ||
{% if errors %} | ||
{% for key,value in errors.items %} | ||
{{ key }} : {{ value }} | ||
{% endfor %} | ||
{% endif %} | ||
<button type="submit" class="btn btn-default">Sign up</button> | ||
</form> | ||
{% endblock content %} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from django.test import TestCase | ||
from capi_project.models import Case | ||
|
||
from rest_framework.test import APIRequestFactory | ||
from django.test import Client | ||
|
||
import json | ||
|
||
class CaseTestCase(TestCase): | ||
def setUp(self): | ||
case = Case.create(caseid=1,firstpage=21,lastpage=25,jurisdiction="Illinois",citation="177 Ill. 2d 21",docketnumber="No. 81291",decisiondate="1997-06-19",court="Illinois Supreme Court",name="TRANS STATES AIRLINES, Appellee, v. PRATT & WHITNEY CANADA, INC., Appellant",court_abbreviation="Ill.",name_abbreviation="Trans States Airlines v. Pratt & Whitney Canada, Inc.",volume="177",reporter="Ill. 2d",) | ||
case = Case.create(caseid=2,firstpage=166,lastpage=184,jurisdiction="New York",citation="229 A.D.2d 313",docketnumber="",decisiondate="1996-07-02",decisiondate_original="1996-07-02",court="New York Supreme Court, Appellate Division",name="Angelo Ramirez, Appellant, v. New York City School Construction Authority, Respondent, et al., Defendant",court_abbreviation="N.Y. App. Div.",name_abbreviation="Ramirez v. New York City School Construction Authority",volume="229",reporter="A.D.2d") | ||
|
||
def test_api_urls(self): | ||
c = Client() | ||
response = c.get('/cases/') | ||
assert response.status_code == 200 | ||
assert response.accepted_renderer.format != 'json' | ||
response = c.get('/cases/?format=json') | ||
assert response.status_code == 200 | ||
assert response.accepted_renderer.format == 'json' | ||
response = c.get('/cases/jurisdictions') | ||
assert response.accepted_renderer.format != 'json' | ||
assert response.status_code == 200 | ||
response = c.get('/cases/jurisdictions?format=json') | ||
assert response.status_code == 200 | ||
assert response.accepted_renderer.format == 'json' | ||
|
||
def test_jurisdictions(self): | ||
c = Client() | ||
response = c.get('/cases/jurisdictions?format=json') | ||
assert response.status_code == 200 | ||
assert response.accepted_renderer.format == 'json' | ||
jurisdictions = json.loads(response.content) | ||
assert len(jurisdictions) == 2 | ||
assert "New York" in jurisdictions | ||
|
||
|
||
def test_case(self): | ||
c = Client() | ||
response = c.get('/cases/Illinois/Ill%2E%202d?format=json') | ||
assert response.status_code == 200 | ||
assert response.accepted_renderer.format == 'json' | ||
jurisdictions = json.loads(response.content) | ||
assert len(jurisdictions) == 2 | ||
assert "New York" in jurisdictions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.