मैं अपने वर्तमान pytest3/Django1.7 पर्यावरण में pytest-django जोड़ने की कोशिश कर रहा हूं।पीईटीएस्ट-डीजेगो गायब django_migration तालिका पर विफल रहा
वर्तमान में हम प्लगइन का उपयोग नहीं कर रहे हैं और कुछ परीक्षणों
सब कुछ लगता है नेत्रहीन अच्छे लग रहे हैं और परीक्षण अंत तक पारित करने के लिए जब मैं निम्न त्रुटि संदेश मिलता है प्रतीत बीच साझा राज्य से पीड़ित किया गया है:
request = <SubRequest '_django_db_marker' for <Function 'test_filter_recurring_outside_sync_window'>>
@pytest.fixture(autouse=True)
def _django_db_marker(request):
"""Implement the django_db marker, internal to pytest-django.
This will dynamically request the ``db`` or ``transactional_db``
fixtures as required by the django_db marker.
"""
marker = request.keywords.get('django_db', None)
if marker:
validate_django_db(marker)
if marker.transaction:
getfixturevalue(request, 'transactional_db')
else:
getfixturevalue(request, 'db')
ve/lib/python2.7/site-packages/pytest_django/plugin.py:376:
self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x11976a478>
query = 'SELECT "django_migrations"."app", "django_migrations"."name" FROM "django_migrations"', params =()
def execute(self, query, params=None):
if params is None:
return Database.Cursor.execute(self, query)
query = self.convert_query(query)
> return Database.Cursor.execute(self, query, params)
E OperationalError: no such table: django_migrations
ve/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py:485: OperationalError
मैंने ensure_schema
के साथ conftest.py
में तालिका बनाने का प्रयास किया। मैंने --nomigrations
और --create-db
से pytest
के हर विकल्प का प्रयास किया है।
मुझे लगता है कि यह एक विरासत प्रणाली के साथ एक अजीब कॉन्फ़िगरेशन समस्या है, लेकिन मुझे यकीन नहीं है कि कहां देखना शुरू करना है। किसी के पास सुझाव हैं?
क्या आपने मस्तिष्क की कोशिश की है और प्रत्येक ऐप के लिए अलग से माइग्रेट किया है? यह आपके मुद्दों को कई बार –
पर हल कर सकता है क्या आप 'py.test/path/to/django/project --nomigrations --ds = myproject.settings.test' जैसे कुछ उपयोग कर रहे हैं? आप क्या आदेश चला रहे हैं? – FlipperPA