· 4 years ago · Aug 01, 2021, 05:26 PM
1========================================================================================== test session starts ==========================================================================================
2platform win32 -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- d:\dev\hw02_community-master\venv\scripts\python.exe
3django: settings: yatube.settings (from ini)
4rootdir: D:\Dev\hw02_community-master1, configfile: pytest.ini, testpaths: tests/
5plugins: django-3.8.0, pythonpath-0.7.3
6collected 7 items
7
8tests/test_homework.py::TestPost::test_index_view ERROR [ 14%]
9tests/test_homework.py::TestPost::test_post_create ERROR [ 28%]
10tests/test_homework.py::TestGroup::test_group_create ERROR [ 42%]
11tests/test_homework.py::TestGroupView::test_group_view ERROR [ 57%]
12tests/test_homework.py::TestPost::test_post_model PASSED [ 71%]
13tests/test_homework.py::TestPost::test_post_admin PASSED [ 85%]
14tests/test_homework.py::TestGroup::test_group_model PASSED [100%]
15
16================================================================================================ ERRORS =================================================================================================
17______________________________________________________________________________ ERROR at setup of TestPost.test_index_view _______________________________________________________________________________
18
19self = <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>
20sql = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
21ignored_wrapper_args = (False, {'connection': <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x0000025F9FEAC310>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>})
22
23 def _execute(self, sql, params, *ignored_wrapper_args):
24 self.db.validate_no_broken_transaction()
25 with self.db.wrap_database_errors:
26 if params is None:
27> return self.cursor.execute(sql)
28
29..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82:
30_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
31
32self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
33query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
34
35 def execute(self, query, params=None):
36 if params is None:
37> return Database.Cursor.execute(self, query)
38E sqlite3.OperationalError: table "posts_group" already exists
39
40..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
41
42The above exception was the direct cause of the following exception:
43
44request = <SubRequest 'django_db_setup' for <Function test_index_view>>, django_test_environment = None, django_db_blocker = <pytest_django.plugin._DatabaseBlocker object at 0x0000025F9EBEA400>
45django_db_use_migrations = True, django_db_keepdb = False, django_db_createdb = False, django_db_modify_db_settings = None
46
47 @pytest.fixture(scope="session")
48 def django_db_setup(
49 request,
50 django_test_environment,
51 django_db_blocker,
52 django_db_use_migrations,
53 django_db_keepdb,
54 django_db_createdb,
55 django_db_modify_db_settings,
56 ):
57 """Top level fixture to ensure test databases are available"""
58 from .compat import setup_databases, teardown_databases
59
60 setup_databases_args = {}
61
62 if not django_db_use_migrations:
63 _disable_native_migrations()
64
65 if django_db_keepdb and not django_db_createdb:
66 setup_databases_args["keepdb"] = True
67
68 with django_db_blocker.unblock():
69> db_cfg = setup_databases(
70 verbosity=request.config.option.verbose,
71 interactive=False,
72 **setup_databases_args
73 )
74
75..\hw02_community-master\venv\lib\site-packages\pytest_django\fixtures.py:105:
76_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
77..\hw02_community-master\venv\lib\site-packages\django\test\utils.py:170: in setup_databases
78 connection.creation.create_test_db(
79..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\creation.py:67: in create_test_db
80 call_command(
81..\hw02_community-master\venv\lib\site-packages\django\core\management\__init__.py:148: in call_command
82 return command.execute(*args, **defaults)
83..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:364: in execute
84 output = self.handle(*args, **options)
85..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:83: in wrapped
86 res = handle_func(*args, **kwargs)
87..\hw02_community-master\venv\lib\site-packages\django\core\management\commands\migrate.py:232: in handle
88 post_migrate_state = executor.migrate(
89..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:117: in migrate
90 state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
91..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:147: in _migrate_all_forwards
92 state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
93..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:245: in apply_migration
94 state = migration.apply(state, schema_editor)
95..\hw02_community-master\venv\lib\site-packages\django\db\migrations\migration.py:124: in apply
96 operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
97..\hw02_community-master\venv\lib\site-packages\django\db\migrations\operations\models.py:92: in database_forwards
98 schema_editor.create_model(model)
99..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:307: in create_model
100 self.execute(sql, params or None)
101..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:137: in execute
102 cursor.execute(sql, params)
103..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:67: in execute
104 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
105..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:76: in _execute_with_wrappers
106 return executor(sql, params, many, context)
107..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:84: in _execute
108 return self.cursor.execute(sql, params)
109..\hw02_community-master\venv\lib\site-packages\django\db\utils.py:89: in __exit__
110 raise dj_exc_value.with_traceback(traceback) from exc_value
111..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82: in _execute
112 return self.cursor.execute(sql)
113_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
114
115self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
116query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
117
118 def execute(self, query, params=None):
119 if params is None:
120> return Database.Cursor.execute(self, query)
121E django.db.utils.OperationalError: table "posts_group" already exists
122
123..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
124----------------------------------------------------------------------------------------- Captured stdout setup -----------------------------------------------------------------------------------------
125Operations to perform:
126 Synchronize unmigrated apps: messages, staticfiles
127 Apply all migrations: admin, auth, contenttypes, posts, sessions
128Synchronizing apps without migrations:
129 Creating tables...
130 Running deferred SQL...
131Running migrations:
132 Applying contenttypes.0001_initial... OK
133 Applying auth.0001_initial... OK
134 Applying admin.0001_initial... OK
135 Applying admin.0002_logentry_remove_auto_add... OK
136 Applying admin.0003_logentry_add_action_flag_choices... OK
137 Applying contenttypes.0002_remove_content_type_name... OK
138 Applying auth.0002_alter_permission_name_max_length... OK
139 Applying auth.0003_alter_user_email_max_length... OK
140 Applying auth.0004_alter_user_username_opts... OK
141 Applying auth.0005_alter_user_last_login_null... OK
142 Applying auth.0006_require_contenttypes_0002... OK
143 Applying auth.0007_alter_validators_add_error_messages... OK
144 Applying auth.0008_alter_user_username_max_length... OK
145 Applying auth.0009_alter_user_last_name_max_length... OK
146 Applying auth.0010_alter_group_name_max_length... OK
147 Applying auth.0011_update_proxy_permissions... OK
148 Applying posts.0001_initial... OK
149 Applying posts.0002_auto_20210719_1518...
150----------------------------------------------------------------------------------------- Captured stderr setup -----------------------------------------------------------------------------------------
151Creating test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')...
152______________________________________________________________________________ ERROR at setup of TestPost.test_post_create ______________________________________________________________________________
153
154self = <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>
155sql = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
156ignored_wrapper_args = (False, {'connection': <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x0000025F9FEAC310>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>})
157
158 def _execute(self, sql, params, *ignored_wrapper_args):
159 self.db.validate_no_broken_transaction()
160 with self.db.wrap_database_errors:
161 if params is None:
162> return self.cursor.execute(sql)
163
164..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82:
165_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
166
167self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
168query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
169
170 def execute(self, query, params=None):
171 if params is None:
172> return Database.Cursor.execute(self, query)
173E sqlite3.OperationalError: table "posts_group" already exists
174
175..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
176
177The above exception was the direct cause of the following exception:
178
179request = <SubRequest 'django_db_setup' for <Function test_index_view>>, django_test_environment = None, django_db_blocker = <pytest_django.plugin._DatabaseBlocker object at 0x0000025F9EBEA400>
180django_db_use_migrations = True, django_db_keepdb = False, django_db_createdb = False, django_db_modify_db_settings = None
181
182 @pytest.fixture(scope="session")
183 def django_db_setup(
184 request,
185 django_test_environment,
186 django_db_blocker,
187 django_db_use_migrations,
188 django_db_keepdb,
189 django_db_createdb,
190 django_db_modify_db_settings,
191 ):
192 """Top level fixture to ensure test databases are available"""
193 from .compat import setup_databases, teardown_databases
194
195 setup_databases_args = {}
196
197 if not django_db_use_migrations:
198 _disable_native_migrations()
199
200 if django_db_keepdb and not django_db_createdb:
201 setup_databases_args["keepdb"] = True
202
203 with django_db_blocker.unblock():
204> db_cfg = setup_databases(
205 verbosity=request.config.option.verbose,
206 interactive=False,
207 **setup_databases_args
208 )
209
210..\hw02_community-master\venv\lib\site-packages\pytest_django\fixtures.py:105:
211_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
212..\hw02_community-master\venv\lib\site-packages\django\test\utils.py:170: in setup_databases
213 connection.creation.create_test_db(
214..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\creation.py:67: in create_test_db
215 call_command(
216..\hw02_community-master\venv\lib\site-packages\django\core\management\__init__.py:148: in call_command
217 return command.execute(*args, **defaults)
218..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:364: in execute
219 output = self.handle(*args, **options)
220..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:83: in wrapped
221 res = handle_func(*args, **kwargs)
222..\hw02_community-master\venv\lib\site-packages\django\core\management\commands\migrate.py:232: in handle
223 post_migrate_state = executor.migrate(
224..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:117: in migrate
225 state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
226..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:147: in _migrate_all_forwards
227 state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
228..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:245: in apply_migration
229 state = migration.apply(state, schema_editor)
230..\hw02_community-master\venv\lib\site-packages\django\db\migrations\migration.py:124: in apply
231 operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
232..\hw02_community-master\venv\lib\site-packages\django\db\migrations\operations\models.py:92: in database_forwards
233 schema_editor.create_model(model)
234..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:307: in create_model
235 self.execute(sql, params or None)
236..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:137: in execute
237 cursor.execute(sql, params)
238..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:67: in execute
239 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
240..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:76: in _execute_with_wrappers
241 return executor(sql, params, many, context)
242..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:84: in _execute
243 return self.cursor.execute(sql, params)
244..\hw02_community-master\venv\lib\site-packages\django\db\utils.py:89: in __exit__
245 raise dj_exc_value.with_traceback(traceback) from exc_value
246..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82: in _execute
247 return self.cursor.execute(sql)
248_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
249
250self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
251query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
252
253 def execute(self, query, params=None):
254 if params is None:
255> return Database.Cursor.execute(self, query)
256E django.db.utils.OperationalError: table "posts_group" already exists
257
258..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
259_____________________________________________________________________________ ERROR at setup of TestGroup.test_group_create _____________________________________________________________________________
260
261self = <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>
262sql = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
263ignored_wrapper_args = (False, {'connection': <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x0000025F9FEAC310>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>})
264
265 def _execute(self, sql, params, *ignored_wrapper_args):
266 self.db.validate_no_broken_transaction()
267 with self.db.wrap_database_errors:
268 if params is None:
269> return self.cursor.execute(sql)
270
271..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82:
272_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
273
274self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
275query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
276
277 def execute(self, query, params=None):
278 if params is None:
279> return Database.Cursor.execute(self, query)
280E sqlite3.OperationalError: table "posts_group" already exists
281
282..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
283
284The above exception was the direct cause of the following exception:
285
286request = <SubRequest 'django_db_setup' for <Function test_index_view>>, django_test_environment = None, django_db_blocker = <pytest_django.plugin._DatabaseBlocker object at 0x0000025F9EBEA400>
287django_db_use_migrations = True, django_db_keepdb = False, django_db_createdb = False, django_db_modify_db_settings = None
288
289 @pytest.fixture(scope="session")
290 def django_db_setup(
291 request,
292 django_test_environment,
293 django_db_blocker,
294 django_db_use_migrations,
295 django_db_keepdb,
296 django_db_createdb,
297 django_db_modify_db_settings,
298 ):
299 """Top level fixture to ensure test databases are available"""
300 from .compat import setup_databases, teardown_databases
301
302 setup_databases_args = {}
303
304 if not django_db_use_migrations:
305 _disable_native_migrations()
306
307 if django_db_keepdb and not django_db_createdb:
308 setup_databases_args["keepdb"] = True
309
310 with django_db_blocker.unblock():
311> db_cfg = setup_databases(
312 verbosity=request.config.option.verbose,
313 interactive=False,
314 **setup_databases_args
315 )
316
317..\hw02_community-master\venv\lib\site-packages\pytest_django\fixtures.py:105:
318_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
319..\hw02_community-master\venv\lib\site-packages\django\test\utils.py:170: in setup_databases
320 connection.creation.create_test_db(
321..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\creation.py:67: in create_test_db
322 call_command(
323..\hw02_community-master\venv\lib\site-packages\django\core\management\__init__.py:148: in call_command
324 return command.execute(*args, **defaults)
325..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:364: in execute
326 output = self.handle(*args, **options)
327..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:83: in wrapped
328 res = handle_func(*args, **kwargs)
329..\hw02_community-master\venv\lib\site-packages\django\core\management\commands\migrate.py:232: in handle
330 post_migrate_state = executor.migrate(
331..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:117: in migrate
332 state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
333..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:147: in _migrate_all_forwards
334 state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
335..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:245: in apply_migration
336 state = migration.apply(state, schema_editor)
337..\hw02_community-master\venv\lib\site-packages\django\db\migrations\migration.py:124: in apply
338 operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
339..\hw02_community-master\venv\lib\site-packages\django\db\migrations\operations\models.py:92: in database_forwards
340 schema_editor.create_model(model)
341..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:307: in create_model
342 self.execute(sql, params or None)
343..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:137: in execute
344 cursor.execute(sql, params)
345..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:67: in execute
346 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
347..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:76: in _execute_with_wrappers
348 return executor(sql, params, many, context)
349..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:84: in _execute
350 return self.cursor.execute(sql, params)
351..\hw02_community-master\venv\lib\site-packages\django\db\utils.py:89: in __exit__
352 raise dj_exc_value.with_traceback(traceback) from exc_value
353..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82: in _execute
354 return self.cursor.execute(sql)
355_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
356
357self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
358query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
359
360 def execute(self, query, params=None):
361 if params is None:
362> return Database.Cursor.execute(self, query)
363E django.db.utils.OperationalError: table "posts_group" already exists
364
365..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
366____________________________________________________________________________ ERROR at setup of TestGroupView.test_group_view ____________________________________________________________________________
367
368self = <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>
369sql = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
370ignored_wrapper_args = (False, {'connection': <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x0000025F9FEAC310>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x0000025FA043E6D0>})
371
372 def _execute(self, sql, params, *ignored_wrapper_args):
373 self.db.validate_no_broken_transaction()
374 with self.db.wrap_database_errors:
375 if params is None:
376> return self.cursor.execute(sql)
377
378..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82:
379_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
380
381self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
382query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
383
384 def execute(self, query, params=None):
385 if params is None:
386> return Database.Cursor.execute(self, query)
387E sqlite3.OperationalError: table "posts_group" already exists
388
389..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
390
391The above exception was the direct cause of the following exception:
392
393request = <SubRequest 'django_db_setup' for <Function test_index_view>>, django_test_environment = None, django_db_blocker = <pytest_django.plugin._DatabaseBlocker object at 0x0000025F9EBEA400>
394django_db_use_migrations = True, django_db_keepdb = False, django_db_createdb = False, django_db_modify_db_settings = None
395
396 @pytest.fixture(scope="session")
397 def django_db_setup(
398 request,
399 django_test_environment,
400 django_db_blocker,
401 django_db_use_migrations,
402 django_db_keepdb,
403 django_db_createdb,
404 django_db_modify_db_settings,
405 ):
406 """Top level fixture to ensure test databases are available"""
407 from .compat import setup_databases, teardown_databases
408
409 setup_databases_args = {}
410
411 if not django_db_use_migrations:
412 _disable_native_migrations()
413
414 if django_db_keepdb and not django_db_createdb:
415 setup_databases_args["keepdb"] = True
416
417 with django_db_blocker.unblock():
418> db_cfg = setup_databases(
419 verbosity=request.config.option.verbose,
420 interactive=False,
421 **setup_databases_args
422 )
423
424..\hw02_community-master\venv\lib\site-packages\pytest_django\fixtures.py:105:
425_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
426..\hw02_community-master\venv\lib\site-packages\django\test\utils.py:170: in setup_databases
427 connection.creation.create_test_db(
428..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\creation.py:67: in create_test_db
429 call_command(
430..\hw02_community-master\venv\lib\site-packages\django\core\management\__init__.py:148: in call_command
431 return command.execute(*args, **defaults)
432..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:364: in execute
433 output = self.handle(*args, **options)
434..\hw02_community-master\venv\lib\site-packages\django\core\management\base.py:83: in wrapped
435 res = handle_func(*args, **kwargs)
436..\hw02_community-master\venv\lib\site-packages\django\core\management\commands\migrate.py:232: in handle
437 post_migrate_state = executor.migrate(
438..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:117: in migrate
439 state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
440..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:147: in _migrate_all_forwards
441 state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
442..\hw02_community-master\venv\lib\site-packages\django\db\migrations\executor.py:245: in apply_migration
443 state = migration.apply(state, schema_editor)
444..\hw02_community-master\venv\lib\site-packages\django\db\migrations\migration.py:124: in apply
445 operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
446..\hw02_community-master\venv\lib\site-packages\django\db\migrations\operations\models.py:92: in database_forwards
447 schema_editor.create_model(model)
448..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:307: in create_model
449 self.execute(sql, params or None)
450..\hw02_community-master\venv\lib\site-packages\django\db\backends\base\schema.py:137: in execute
451 cursor.execute(sql, params)
452..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:67: in execute
453 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
454..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:76: in _execute_with_wrappers
455 return executor(sql, params, many, context)
456..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:84: in _execute
457 return self.cursor.execute(sql, params)
458..\hw02_community-master\venv\lib\site-packages\django\db\utils.py:89: in __exit__
459 raise dj_exc_value.with_traceback(traceback) from exc_value
460..\hw02_community-master\venv\lib\site-packages\django\db\backends\utils.py:82: in _execute
461 return self.cursor.execute(sql)
462_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
463
464self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x0000025FA0327DC0>
465query = 'CREATE TABLE "posts_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "titel" varchar(200) NOT NULL, "slug" varchar(50) NOT NULL, "description" text NOT NULL)', params = None
466
467 def execute(self, query, params=None):
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490 if params is None:
491> return Database.Cursor.execute(self, query)
492E django.db.utils.OperationalError: table "posts_group" already exists
493
494..\hw02_community-master\venv\lib\site-packages\django\db\backends\sqlite3\base.py:381: OperationalError
495======================================================================================== short test summary info ========================================================================================
496ERROR tests/test_homework.py::TestPost::test_index_view - django.db.utils.OperationalError: table "posts_group" already exists
497ERROR tests/test_homework.py::TestPost::test_post_create - django.db.utils.OperationalError: table "posts_group" already exists
498ERROR tests/test_homework.py::TestGroup::test_group_create - django.db.utils.OperationalError: table "posts_group" already exists
499ERROR tests/test_homework.py::TestGroupView::test_group_view - django.db.utils.OperationalError: table "posts_group" already exists
500====================================================================================== 3 passed, 4 errors in 0.78s ======================================================================================