def test_post_task_create(self):
form_data = {
'name': 'Totoro',
'description': 'must watch it!',
'status': self.status2.id,
}
response = self.client.post(reverse('task_create'), form_data, follow=True)
print("Redirected to:", response.redirect_chain)
print("Current URL after post:", response.request['PATH_INFO'])
self.assertEqual(response.status_code, 302)
self.assertTrue(Task.objects.filter(name='Totoro').exists())
task = Task.objects.get(name='Totoro')
self.assertEqual(task.author_id, self.user.id)
self.assertEqual(task.author.first_name, 'Al')
self.assertRedirects(response, '/tasks/')
self.assertEqual(task.status.id, self.status2.id)
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://example1.com")
driver.execute_script("window.localStorage.setItem('key1', 'value1');")
driver.get("https://example2.com")
driver.execute_script("window.localStorage.setItem('key2', 'value2');")
driver.get("https://example1.com")
local_storage_value1 = driver.execute_script("return window.localStorage.getItem('key1');")
print("LocalStorage value for example1.com: ", local_storage_value1)
driver.get("https://example2.com")
local_storage_value2 = driver.execute_script("return window.localStorage.getItem('key2');")
print("LocalStorage value for example2.com: ", local_storage_value2)
driver.quit()
my_dict = {'a': 1}
my_dict.update({'b': 2})
print(my_dict) # Результат: {'a': 1, 'b': 2}
Опять же под себя нужно подстраивать. Но это вариант такой себе.
Вы можете динамически определяться max-height при помощи javascript: