mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-04-18 05:41:04 +00:00
Merge branch 'master' of github.com:pydanny/django-admin2
This commit is contained in:
commit
7ca17936f1
3 changed files with 38 additions and 13 deletions
5
example/blog/admin.py
Normal file
5
example/blog/admin.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from django.contrib import admin
|
||||
from .models import Post, Comment
|
||||
|
||||
admin.site.register(Post)
|
||||
admin.site.register(Comment)
|
||||
|
|
@ -1,16 +1,36 @@
|
|||
"""
|
||||
This file demonstrates writing tests using the unittest module. These will pass
|
||||
when you run "manage.py test".
|
||||
from django.utils import unittest
|
||||
from django.test.client import RequestFactory
|
||||
|
||||
Replace this with more appropriate tests for your application.
|
||||
"""
|
||||
from djadmin2 import views
|
||||
|
||||
from django.test import TestCase
|
||||
class ViewTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.factory = RequestFactory()
|
||||
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.assertEqual(1 + 1, 2)
|
||||
class IndexViewTest(ViewTest):
|
||||
def test_response_ok(self):
|
||||
request = self.factory.get('/admin/blog/post/')
|
||||
response = views.IndexView.as_view()(request)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
class ModelListViewTest(ViewTest):
|
||||
pass
|
||||
|
||||
|
||||
class ModelDetailViewTest(ViewTest):
|
||||
pass
|
||||
|
||||
|
||||
class ModelEditFormViewTest(ViewTest):
|
||||
pass
|
||||
|
||||
|
||||
class ModelAddFormViewTest(ViewTest):
|
||||
pass
|
||||
|
||||
|
||||
class ModelDeleteViewTest(ViewTest):
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ admin.autodiscover()
|
|||
|
||||
urlpatterns = patterns('',
|
||||
# Examples:
|
||||
url(r'^admin2/$', include('djadmin2.urls')),
|
||||
url(r'^admin2/', include('djadmin2.urls')),
|
||||
# url(r'^example/', include('example.foo.urls')),
|
||||
|
||||
# Uncomment the admin/doc line below to enable admin documentation:
|
||||
|
|
|
|||
Loading…
Reference in a new issue