I was wondering what the recommended method is for adding unit tests to my own Arches app.
The unit test section in Arches core looks like an isolated python module and I can't seem to import e.g. the test_settings.py file from my own app. Also, when I try copying that settings file to my own app and then try to run my own unit tests with it (from manage.py in my own app), the process still looks for database init (sql) files in core Arches folders. And if I should copy/paste test_settings.py into my own app, what should I set settings like ROOT_DIR and TEST_ROOT to? My current settings: ROOT_DIR = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) ROOT_DIR = os.path.normpath(os.path.join(ROOT_DIR, '..' ,'..', 'arches', 'arches')) TEST_ROOT = os.path.normpath(os.path.join(ROOT_DIR, '..', 'tests')) But now I'm getting this stack: Destroying old test database for alias 'default'... Traceback (most recent call last): File "manage.py", line 35, in <module> execute_from_command_line(sys.argv) File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py" , line 364, in execute_from_command_line utility.execute() File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py" , line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/commands/test.py" , line 29, in run_from_argv super(Command, self).run_from_argv(argv) File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/base.py" , line 283, in run_from_argv self.execute(*args, **cmd_options) File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/base.py" , line 330, in execute output = self.handle(*args, **options) File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/commands/test.py" , line 62, in handle failures = test_runner.run_tests(test_labels) File "/web_root/ENV/local/lib/python2.7/site-packages/django/test/runner.py", line 601, in run_tests old_config = self.setup_databases() File "/web_root/ENV/local/lib/python2.7/site-packages/django/test/runner.py", line 546, in setup_databases self.parallel, **kwargs File "/web_root/ENV/local/lib/python2.7/site-packages/django/test/utils.py", line 187, in setup_databases serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True ), File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/backends/base/creation.py" , line 69, in create_test_db run_syncdb=True, File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py" , line 131, in call_command return command.execute(*args, **defaults) File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/base.py" , line 330, in execute output = self.handle(*args, **options) File "/web_root/ENV/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py" , line 204, in handle fake_initial=fake_initial, File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/migrations/executor.py" , line 115, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/migrations/executor.py" , line 145, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial= fake_initial) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/migrations/executor.py" , line 244, in apply_migration state = migration.apply(state, schema_editor) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/migrations/migration.py" , line 129, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/migrations/operations/special.py" , line 193, in database_forwards self.code(from_state.apps, schema_editor) File "/web_root/arches/arches/app/models/migrations/0001_initial.py", line 55, in make_permissions create_permissions(model_app, verbosity=0) File "/web_root/ENV/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py" , line 63, in create_permissions ctype = ContentType.objects.db_manager(using).get_for_model(klass) File "/web_root/ENV/local/lib/python2.7/site-packages/django/contrib/contenttypes/models.py" , line 60, in get_for_model model=opts.model_name, File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/manager.py" , line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/query.py", line 466, in get_or_create return self._create_object_from_params(lookup, params) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/query.py", line 506, in _create_object_from_params six.reraise(*exc_info) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/query.py", line 498, in _create_object_from_params obj = self.create(**params) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/query.py", line 394, in create obj.save(force_insert=True, using=self.db) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/base.py", line 808, in save force_update=force_update, update_fields=update_fields) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/base.py", line 838, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/base.py", line 924, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/base.py", line 963, in _do_insert using=using, raw=raw) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/manager.py" , line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/query.py", line 1076, in _insert return query.get_compiler(using=using).execute_sql(return_id) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" , line 1112, in execute_sql cursor.execute(sql, params) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/backends/utils.py" , line 64, in execute return self.cursor.execute(sql, params) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/web_root/ENV/local/lib/python2.7/site-packages/django/db/backends/utils.py" , line 64, in execute return self.cursor.execute(sql, params) django.db.utils.IntegrityError: null value in column "name" violates not- null constraint DETAIL: Failing row contains (1, null, models, cardmodel). Thanks! Vincent -- -- To post, send email to archesproject@googlegroups.com. To unsubscribe, send email to archesproject+unsubscr...@googlegroups.com. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en --- You received this message because you are subscribed to the Google Groups "Arches Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to archesproject+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.