Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7037509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:33:14+00:00 2026-05-28T01:33:14+00:00

I am making unittests for a django app. I need some data in the

  • 0

I am making unittests for a django app. I need some data in the database for my tests so I am using a json fixture.

I have two fixtures:

  1. for users and it works ok.
  2. for some webpages

The fixture 2 cause the following error:

Problem installing fixture 'C:\Users\luc\Dev\Hg\mnl-adminpub\website\fixtures\website-unittest.json': Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\django\core\management\commands\loaddata.py", line 169, in handle
    obj.save(using=using)
  File "C:\Python26\lib\site-packages\django\core\serializers\base.py", line 165, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "C:\Python26\lib\site-packages\django\db\models\base.py", line 528, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "C:\Python26\lib\site-packages\django\db\models\manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "C:\Python26\lib\site-packages\django\db\models\query.py", line 1479, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 783, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 727, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python26\lib\site-packages\django\db\backends\mysql\base.py", line 86, in execute
    return self.cursor.execute(query, args)
  File "C:\Python26\lib\site-packages\MySQLdb\cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "C:\Python26\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1366, "Incorrect string value: '\\xE2\\x80\\xA8<br...' for column 'html' at row 1")

I’ve created the fixture with dumpdata. I’ve tested it with loaddata and it works fine. I am using mysql.

Any idea of the possible cause of the problem?

Thanks for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:33:14+00:00Added an answer on May 28, 2026 at 1:33 am

    You should use TEST_CHARSET, but inside DATABASE config. Like that:

    DATABASES = {
          'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': 'test_sbet',                      
            'USER': 'test_sbet',                      
            'TEST_CHARSET': 'UTF8',
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a django web application, and I'm making unittests & selenium functional tests.
I'm using Test::Unit::TestCase to write some unit tests. Currently, I have a setup function
I'm writing tests for a Django application that uses an external data source .
I am setting up a rails app and I just finished making some unit
I have some test classes that are making use of spring-batch, and hibernate. My
I have some unit tests which exercise code which makes calls out to a
I have an app that uses EF POCO for accessing data. Everything works great,
Quite often I have unit tests using MSTest for code that is in a
I am currently making some Acceptance-Tests that will help drive the design of a
I have a ListTester.java file in which I've created with some unit tests in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.