Answer the question
In order to leave comments, you need to log in
Why doesn't an exception occur?
I am writing tests for a Django application:
class FolderViewsTestCase(TestCase):
@classmethod
def setUpTestData(cls):
LinkyUser.objects.create_superuser(
username='test_user',
password='0000'
)
def setUp(self):
self.c = Client()
def test_folder_update_view_status_code_200(self):
self.c.login(username='test_user', password='0000')
user_id = self.c.session['_auth_user_id']
folder = Folder.objects.create(title='test_folder', linky_user_id=user_id)
response = self.c.get(reverse('folder_update', args=[folder.pk]))
self.assertEqual(response.status_code, 200)
user_id = self.c.session['_auth_user_id']
, linky_user_id
is expecting an integer, getting a string, the code works without errors, why?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question