def test_tags_limited_to_user(self):
    'Test that tags returned are for authenticated user'
    user2 = get_user_model().objects.create_user('example@example.com', 'testpass')
    Tag.objects.create(user=user2, name='Tasty')
    tag = Tag.objects.create(user=self.user, name='Just Food')
    res = self.client.get(TAGS_URL)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(len(res.data), 1)
    self.assertEqual(res.data[0]['name'], tag.name)
Test that tags returned are for authenticated user
def test_tags_limited_to_user(self):
    
    user2 = get_user_model().objects.create_user('example@example.com', 'testpass')
    Tag.objects.create(user=user2, name='Tasty')
    tag = Tag.objects.create(user=self.user, name='Just Food')
    res = self.client.get(TAGS_URL)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(len(res.data), 1)
    self.assertEqual(res.data[0]['name'], tag.name)