Updates app to use date instead of boolean
This commit is contained in:
parent
b11b810ec9
commit
1b1e557800
3 changed files with 8 additions and 3 deletions
|
@ -180,6 +180,7 @@ class InboxUpdate(TestCase):
|
|||
datafile = pathlib.Path(__file__).parent.joinpath("../../data/ap_note.json")
|
||||
status_data = json.loads(datafile.read_bytes())
|
||||
status_data["id"] = status.remote_id
|
||||
status_data["updated"] = "2021-12-13T05:09:29Z"
|
||||
|
||||
activity = self.update_json
|
||||
activity["object"] = status_data
|
||||
|
@ -189,4 +190,6 @@ class InboxUpdate(TestCase):
|
|||
|
||||
status.refresh_from_db()
|
||||
self.assertEqual(status.content, "test content in note")
|
||||
self.assertTrue(status.edited)
|
||||
self.assertEqual(status.edited_date.year, 2021)
|
||||
self.assertEqual(status.edited_date.month, 12)
|
||||
self.assertEqual(status.edited_date.day, 13)
|
||||
|
|
|
@ -381,6 +381,7 @@ http://www.fish.com/"""
|
|||
def test_create_status_edit_success(self, mock, *_):
|
||||
"""update an existing status"""
|
||||
status = models.Status.objects.create(content="status", user=self.local_user)
|
||||
self.assertIsNone(status.edited_date)
|
||||
view = views.CreateStatus.as_view()
|
||||
form = forms.CommentForm(
|
||||
{
|
||||
|
@ -400,7 +401,7 @@ http://www.fish.com/"""
|
|||
|
||||
status.refresh_from_db()
|
||||
self.assertEqual(status.content, "<p>hi</p>")
|
||||
self.assertTrue(status.edited)
|
||||
self.assertIsNotNone(status.edited_date)
|
||||
|
||||
def test_create_status_edit_permission_denied(self, *_):
|
||||
"""update an existing status"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue