mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-03-16 22:00:22 +00:00
Merge pull request #261 from krukas/master
[BUGFIX] #255 Fixed MySQL tests failing mysql + admin context
This commit is contained in:
commit
fc0774ddad
2 changed files with 12 additions and 4 deletions
|
|
@ -5,7 +5,12 @@ from optparse import OptionParser
|
|||
|
||||
AVAILABLE_DATABASES = {
|
||||
'psql': {'ENGINE': 'django.db.backends.postgresql_psycopg2'},
|
||||
'mysql': {'ENGINE': 'django.db.backends.mysql'},
|
||||
'mysql': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'OPTIONS': {
|
||||
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
|
||||
},
|
||||
},
|
||||
'sqlite': {'ENGINE': 'django.db.backends.sqlite3'},
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +108,10 @@ def main():
|
|||
TEMPLATES=[{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': ['templates'],
|
||||
'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth']},
|
||||
'OPTIONS': {'context_processors': [
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
]},
|
||||
'APP_DIRS': True,
|
||||
}],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ from watson.models import SearchEntry, has_int_pk
|
|||
|
||||
|
||||
def regex_from_word(word):
|
||||
"""Generates a regext from the given search word."""
|
||||
return "(\s{word})|(^{word})".format(
|
||||
"""Generates a regex from the given search word."""
|
||||
return r"(\s{word})|(^{word})".format(
|
||||
word=re.escape(word),
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue