@@ -114,7 +114,6 @@ def test_delete_known_reminder_returns_204(self):
114
114
response = self .client .delete (url )
115
115
116
116
self .assertEqual (response .status_code , 204 )
117
- self .assertRaises (Reminder .DoesNotExist , Reminder .objects .get , id = self .reminder .id )
118
117
119
118
120
119
class ReminderListTests (AuthenticatedAPITestCase ):
@@ -154,18 +153,26 @@ def test_reminders_in_full_list(self):
154
153
response = self .client .get (url )
155
154
156
155
self .assertEqual (response .status_code , 200 )
156
+ self .assertNotIn (self .rem_dict_two , response .json ())
157
+
158
+ response = self .client .get (f"{ url } ?include_inactive=true" )
157
159
self .assertCountEqual (response .json (), [self .rem_dict_one , self .rem_dict_two ])
158
160
159
161
def test_filter_search (self ):
160
162
url = reverse ('api:bot:reminder-list' )
161
163
response = self .client .get (f'{ url } ?search={ self .author .name } ' )
164
+ self .assertEqual (response .status_code , 200 )
165
+ self .assertCountEqual (response .json (), [self .rem_dict_one ])
162
166
167
+ def test_filter_search_with_inactive (self ):
168
+ url = reverse ('api:bot:reminder-list' )
169
+ response = self .client .get (f'{ url } ?search={ self .author .name } &include_inactive=true' )
163
170
self .assertEqual (response .status_code , 200 )
164
171
self .assertCountEqual (response .json (), [self .rem_dict_one , self .rem_dict_two ])
165
172
166
- def test_filter_field (self ):
173
+ def test_only_active_by_default (self ):
167
174
url = reverse ('api:bot:reminder-list' )
168
- response = self .client .get (f' { url } ?active=true' )
175
+ response = self .client .get (url )
169
176
170
177
self .assertEqual (response .status_code , 200 )
171
178
self .assertEqual (response .json (), [self .rem_dict_one ])
0 commit comments