def test_another_user_cant_edit_pad(self): user_data = { 'email': '*****@*****.**', 'password': '******' } create_user(user_data) client = Client() client.login(**user_data) id = self._create_pads(['pad'])[0] response = client.post(reverse('edit_pad', args=(id, )), {}) self.assertEquals(404, response.status_code)
def test_another_user_cant_edit_pad(self): user_data = { 'email': '*****@*****.**', 'password': '******' } create_user(user_data) client = Client() client.login(**user_data) id = self._create_pads(['pad'])[0] response = client.post(reverse('edit_pad', args=(id,)), {}) self.assertEquals(404, response.status_code)
def test_another_user_cant_delete(self): user_data = { 'email': '*****@*****.**', 'password': '******' } create_user(user_data) note_data = {'name': 'note name', 'text': 'note text'} note = Note.objects.create(user=self.user, **note_data) client = Client() client.login(**user_data) response = client.get(reverse('view_note', args=(note.id, )), {}) self.assertEqual(404, response.status_code)
def setUp(self): user_data = { 'email': '*****@*****.**', 'password': '******' } self.user = create_user(user_data) self.client.login(**user_data)
def test_another_user_cant_delete(self): user_data = { 'email': '*****@*****.**', 'password': '******' } create_user(user_data) note_data = { 'name': 'note name', 'text': 'note text' } note = Note.objects.create(user=self.user, **note_data) client = Client() client.login(**user_data) response = client.get(reverse('view_note', args=(note.id,)), {}) self.assertEquals(404, response.status_code)