def test_unicode(self): """ Testing string representation of TOdo object """ user = UserFactory() user.save() todo = TodoFactory(user=user, text=u'my task') todo.save() self.assertEqual(unicode(todo), u'my task')
def test_user(self): """ Create user with factory """ self.assertEqual(User.objects.count(), 0) user = UserFactory() user.save() self.assertEqual(User.objects.count(), 1)
def test_todo(self): """ Create todo with factory """ self.assertEqual(Todo.objects.count(), 0) user = UserFactory() user.save() todo = TodoFactory(user=user) todo.save() self.assertEqual(Todo.objects.count(), 1)