def test_link_set_in_dump(self): my_title = 'Simple Dump' dump = Dump(title=my_title) dump.save() link = dump.link_set.create(url='http://localhost') link.save() self.assertIsInstance(link, Link) self.assertEqual(dump.link_set.all()[0], link) self.assertEqual(link.dump.title, my_title)
def test_adding_tags(self): dump = Dump(title='Hello') dump.save() dump.tags.add('tag1') self.assertEqual('tag1', dump.tags.all()[0].name)
def test_response(self): dump = Dump(title='Title') dump.save() response = self.client.get('/dumps/%d/' % dump.id) self.assertEqual(response.status_code, 200)