File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 44from rest_framework .test import APIRequestFactory , force_authenticate
55
66from .models import Problem
7- from .views import ProblemView , TagView
7+ from .views import ProblemView , TagView , TagListView
88from account .models import User
99
1010# Create your tests here.
@@ -111,4 +111,18 @@ def testZ_get_tag(self):
111111
112112 self .assertEqual (data .get ("id" ), ac_data ["id" ])
113113 self .assertEqual (data .get ("content" ), ac_data ["content" ])
114- self .assertEqual (data .get ("color" ), ac_data ["color" ])
114+ self .assertEqual (data .get ("color" ), ac_data ["color" ])
115+
116+ class TagListViewTest (TestCase ):
117+ fixtures = ["testdatabase.yaml" ]
118+
119+ def setUp (self ):
120+ self .base_url = "/api/problem/tag/list"
121+ self .factory = APIRequestFactory ()
122+ self .view = TagListView .as_view ()
123+
124+ def testA_get_list (self ):
125+ request = self .factory .get (self .base_url )
126+ response = self .view (request )
127+ self .assertEqual (response .status_code , status .HTTP_200_OK )
128+
You can’t perform that action at this time.
0 commit comments