Merge pull request #11097 from edx/ziafazal/SOL-1560

ziafazal/SOL-1560:load db_fixures when run with --testsonly
This commit is contained in:
Ben Patterson
2016-01-04 09:00:38 -05:00
7 changed files with 178 additions and 39 deletions

View File

@@ -186,7 +186,13 @@ def fulfill_course_milestone(course_key, user):
if not settings.FEATURES.get('MILESTONES_APP', False):
return None
from milestones import api as milestones_api
course_milestones = milestones_api.get_course_milestones(course_key=course_key, relationship="fulfills")
from milestones.exceptions import InvalidMilestoneRelationshipTypeException
try:
course_milestones = milestones_api.get_course_milestones(course_key=course_key, relationship="fulfills")
except InvalidMilestoneRelationshipTypeException:
# we have not seeded milestone relationship types
seed_milestone_relationship_types()
course_milestones = milestones_api.get_course_milestones(course_key=course_key, relationship="fulfills")
for milestone in course_milestones:
milestones_api.add_user_milestone({'id': user.id}, milestone)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -386,7 +386,7 @@ CREATE TABLE `auth_permission` (
PRIMARY KEY (`id`),
UNIQUE KEY `content_type_id` (`content_type_id`,`codename`),
CONSTRAINT `auth__content_type_id_508cf46651277a81_fk_django_content_type_id` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=704 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=710 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `auth_registration`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -480,6 +480,43 @@ CREATE TABLE `auth_userprofile` (
CONSTRAINT `auth_userprofile_user_id_4c194f9b5650ad70_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `bookmarks_bookmark`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bookmarks_bookmark` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`modified` datetime(6) NOT NULL,
`course_key` varchar(255) NOT NULL,
`usage_key` varchar(255) NOT NULL,
`path` longtext NOT NULL,
`user_id` int(11) NOT NULL,
`xblock_cache_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `bookmarks_bookmark_user_id_7059f67cddd52c9a_uniq` (`user_id`,`usage_key`),
KEY `bookmarks_bookmark_c8235886` (`course_key`),
KEY `bookmarks_bookmark_4a93f0de` (`usage_key`),
KEY `bookmarks_bookmark_d452fbf6` (`xblock_cache_id`),
CONSTRAINT `boo_xblock_cache_id_22d48842487ba2d2_fk_bookmarks_xblockcache_id` FOREIGN KEY (`xblock_cache_id`) REFERENCES `bookmarks_xblockcache` (`id`),
CONSTRAINT `bookmarks_bookmark_user_id_33914fa9accf01cb_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `bookmarks_xblockcache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bookmarks_xblockcache` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`modified` datetime(6) NOT NULL,
`course_key` varchar(255) NOT NULL,
`usage_key` varchar(255) NOT NULL,
`display_name` varchar(255) NOT NULL,
`paths` longtext NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `usage_key` (`usage_key`),
KEY `bookmarks_xblockcache_c8235886` (`course_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `branding_brandingapiconfig`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -650,6 +687,24 @@ CREATE TABLE `certificates_certificategenerationcoursesetting` (
KEY `certificates_certificategenerationcoursesetting_c8235886` (`course_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `certificates_certificategenerationhistory`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `certificates_certificategenerationhistory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`modified` datetime(6) NOT NULL,
`course_id` varchar(255) NOT NULL,
`is_regeneration` tinyint(1) NOT NULL,
`generated_by_id` int(11) NOT NULL,
`instructor_task_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `certificates_ce_generated_by_id_4679598e2d7d6e10_fk_auth_user_id` (`generated_by_id`),
KEY `D794923145b81064c232a4d0bfe79880` (`instructor_task_id`),
CONSTRAINT `D794923145b81064c232a4d0bfe79880` FOREIGN KEY (`instructor_task_id`) REFERENCES `instructor_task_instructortask` (`id`),
CONSTRAINT `certificates_ce_generated_by_id_4679598e2d7d6e10_fk_auth_user_id` FOREIGN KEY (`generated_by_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `certificates_certificatehtmlviewconfiguration`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -693,7 +748,9 @@ CREATE TABLE `certificates_certificatetemplateasset` (
`modified` datetime(6) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`asset` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
`asset_slug` varchar(255),
PRIMARY KEY (`id`),
UNIQUE KEY `asset_slug` (`asset_slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `certificates_certificatewhitelist`;
@@ -767,6 +824,7 @@ CREATE TABLE `certificates_generatedcertificate` (
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `certificates_generatedcertificate_user_id_552a0fa6f7d3f7e8_uniq` (`user_id`,`course_id`),
KEY `certificates_generatedcertific_verify_uuid_1b5a14bb83c471ff_uniq` (`verify_uuid`),
CONSTRAINT `certificates_generatedc_user_id_77ed5f7a53121815_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -954,16 +1012,31 @@ CREATE TABLE `course_modes_coursemode` (
`mode_display_name` varchar(255) NOT NULL,
`min_price` int(11) NOT NULL,
`currency` varchar(8) NOT NULL,
`expiration_datetime` datetime(6) DEFAULT NULL,
`expiration_date` date DEFAULT NULL,
`suggested_prices` varchar(255) NOT NULL,
`description` longtext,
`sku` varchar(255) DEFAULT NULL,
`expiration_datetime_is_explicit` tinyint(1) NOT NULL,
`expiration_datetime` datetime(6) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `course_modes_coursemode_course_id_6fbb1796ace558b4_uniq` (`course_id`,`mode_slug`,`currency`),
KEY `course_modes_coursemode_ea134da7` (`course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_modes_coursemodeexpirationconfig`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_modes_coursemodeexpirationconfig` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`change_date` datetime(6) NOT NULL,
`enabled` tinyint(1) NOT NULL,
`verification_window` bigint(20) NOT NULL,
`changed_by_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `course_modes_cour_changed_by_id_4d31fab2bbe98b89_fk_auth_user_id` (`changed_by_id`),
CONSTRAINT `course_modes_cour_changed_by_id_4d31fab2bbe98b89_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_modes_coursemodesarchive`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -1016,9 +1089,47 @@ CREATE TABLE `course_overviews_courseoverview` (
`enrollment_domain` longtext,
`invitation_only` tinyint(1) NOT NULL,
`max_student_enrollments_allowed` int(11) DEFAULT NULL,
`announcement` datetime(6),
`catalog_visibility` longtext,
`course_video_url` longtext,
`effort` longtext,
`short_description` longtext,
`org` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_overviews_courseoverviewimageconfig`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_overviews_courseoverviewimageconfig` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`change_date` datetime(6) NOT NULL,
`enabled` tinyint(1) NOT NULL,
`small_width` int(11) NOT NULL,
`small_height` int(11) NOT NULL,
`large_width` int(11) NOT NULL,
`large_height` int(11) NOT NULL,
`changed_by_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `course_overviews__changed_by_id_54b19ba1c134af6a_fk_auth_user_id` (`changed_by_id`),
CONSTRAINT `course_overviews__changed_by_id_54b19ba1c134af6a_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_overviews_courseoverviewimageset`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_overviews_courseoverviewimageset` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(6) NOT NULL,
`modified` datetime(6) NOT NULL,
`small_url` longtext NOT NULL,
`large_url` longtext NOT NULL,
`course_overview_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `course_overview_id` (`course_overview_id`),
CONSTRAINT `D47baf904f8952eb0e1fafefd558a718` FOREIGN KEY (`course_overview_id`) REFERENCES `course_overviews_courseoverview` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_overviews_courseoverviewtab`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -1445,7 +1556,7 @@ CREATE TABLE `django_content_type` (
`model` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `django_content_type_app_label_45f3b1d93ec8c61c_uniq` (`app_label`,`model`)
) ENGINE=InnoDB AUTO_INCREMENT=234 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=236 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `django_migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -1456,7 +1567,7 @@ CREATE TABLE `django_migrations` (
`name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `django_openid_auth_association`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@@ -2387,6 +2498,7 @@ CREATE TABLE `proctoring_proctoredexamstudentattempt` (
`review_policy_id` int(11) DEFAULT NULL,
`proctored_exam_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`is_status_acknowledged` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `proctoring_proctoredexamstudentatt_user_id_15d13fa8dac316a0_uniq` (`user_id`,`proctored_exam_id`),
KEY `D5e0a120c32f715bfe04a0a57f399ec0` (`proctored_exam_id`),
@@ -2455,8 +2567,12 @@ CREATE TABLE `programs_programsapiconfig` (
`internal_service_url` varchar(200) NOT NULL,
`public_service_url` varchar(200) NOT NULL,
`api_version_number` int(11) NOT NULL,
`enable_student_dashboard` tinyint(1) DEFAULT NULL,
`enable_student_dashboard` tinyint(1) NOT NULL,
`changed_by_id` int(11) DEFAULT NULL,
`cache_ttl` int(10) unsigned NOT NULL,
`authoring_app_css_path` varchar(255) NOT NULL,
`authoring_app_js_path` varchar(255) NOT NULL,
`enable_studio_tab` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `programs_programsa_changed_by_id_b7c3b49d5c0dcd3_fk_auth_user_id` (`changed_by_id`),
CONSTRAINT `programs_programsa_changed_by_id_b7c3b49d5c0dcd3_fk_auth_user_id` FOREIGN KEY (`changed_by_id`) REFERENCES `auth_user` (`id`)
@@ -3229,6 +3345,22 @@ CREATE TABLE `submissions_score` (
CONSTRAINT `subm_submission_id_3fc975fe88442ff7_fk_submissions_submission_id` FOREIGN KEY (`submission_id`) REFERENCES `submissions_submission` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `submissions_scoreannotation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `submissions_scoreannotation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`annotation_type` varchar(255) NOT NULL,
`creator` varchar(255) NOT NULL,
`reason` longtext NOT NULL,
`score_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `submissions_sc_score_id_7b5ef248552cb857_fk_submissions_score_id` (`score_id`),
KEY `submissions_scoreannotation_fd685234` (`annotation_type`),
KEY `submissions_scoreannotation_ee243325` (`creator`),
CONSTRAINT `submissions_sc_score_id_7b5ef248552cb857_fk_submissions_score_id` FOREIGN KEY (`score_id`) REFERENCES `submissions_score` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `submissions_scoresummary`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -3580,6 +3712,7 @@ CREATE TABLE `verify_student_historicalverificationdeadline` (
`history_date` datetime(6) NOT NULL,
`history_type` varchar(1) NOT NULL,
`history_user_id` int(11) DEFAULT NULL,
`deadline_is_explicit` tinyint(1) NOT NULL,
PRIMARY KEY (`history_id`),
KEY `verify_student__history_user_id_1e374d24cb7902c2_fk_auth_user_id` (`history_user_id`),
KEY `verify_student_historicalverificationdeadline_b80bb774` (`id`),
@@ -3702,6 +3835,7 @@ CREATE TABLE `verify_student_verificationdeadline` (
`modified` datetime(6) NOT NULL,
`course_key` varchar(255) NOT NULL,
`deadline` datetime(6) NOT NULL,
`deadline_is_explicit` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `course_key` (`course_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -3804,18 +3938,6 @@ CREATE TABLE `wiki_articlerevision` (
CONSTRAINT `wiki_articlerevision_user_id_183520686b6ead55_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `wiki_articlesubscription`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wiki_articlesubscription` (
`articleplugin_ptr_id` int(11) NOT NULL,
`subscription_ptr_id` int(11) NOT NULL,
PRIMARY KEY (`articleplugin_ptr_id`),
UNIQUE KEY `subscription_ptr_id` (`subscription_ptr_id`),
CONSTRAINT `D3cd26aee5a69a796bee9c6aeab7e317` FOREIGN KEY (`subscription_ptr_id`) REFERENCES `notify_subscription` (`subscription_id`),
CONSTRAINT `w_articleplugin_ptr_id_489742a9a302c93d_fk_wiki_articleplugin_id` FOREIGN KEY (`articleplugin_ptr_id`) REFERENCES `wiki_articleplugin` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `wiki_attachment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;

View File

@@ -3,7 +3,7 @@
"pk": 99,
"model": "certificates.certificategenerationconfiguration",
"fields": {
"change_date": "2015-06-18 11:02:13",
"change_date": "2015-06-18 11:02:13.007790+00:00",
"changed_by": 99,
"enabled": true
}
@@ -12,7 +12,7 @@
"pk": 99,
"model": "certificates.certificategenerationcoursesetting",
"fields": {
"modified": "2015-06-18 11:02:13",
"modified": "2015-06-18 11:02:13.007790+00:00",
"course_key": "course-v1:test_org+3355358979513794782079645765720179311111+test_run",
"enabled": true
}
@@ -21,7 +21,7 @@
"pk": 99,
"model": "auth.user",
"fields": {
"date_joined": "2015-06-12 11:02:13",
"date_joined": "2015-06-12 11:02:13.007790+00:00",
"username": "testcert",
"first_name": "john",
"last_name": "doe",
@@ -53,7 +53,7 @@
"pk": 2,
"model": "certificates.certificatehtmlviewconfiguration",
"fields": {
"change_date": "2050-05-15 11:02:13",
"change_date": "2050-05-15 11:02:13.007790+00:00",
"changed_by": 99,
"enabled": true,
"configuration": "{\"default\": {\"accomplishment_class_append\": \"accomplishment-certificate\",\"platform_name\": \"edX\",\"company_privacy_url\": \"http://www.edx.org/edx-privacy-policy\",\"company_about_url\": \"http://www.edx.org/about-us\",\"company_tos_url\": \"http://www.edx.org/edx-terms-service\",\"company_verified_certificate_url\": \"http://www.edx.org/verified-certificate\",\"document_stylesheet_url_application\": \"/static/certificates/sass/main-ltr.css\",\"logo_src\": \"/static/certificates/images/logo-edx.svg\",\"logo_url\": \"http://www.edx.org\"},\"honor\": {\"certificate_type\": \"Honor Code\",\"document_body_class_append\": \"is-honorcode\"},\"verified\": {\"certificate_type\": \"Verified\",\"document_body_class_append\": \"is-idverified\"},\"xseries\": {\"certificate_type\": \"XSeries\",\"document_body_class_append\": \"is-xseries\"}}"
@@ -73,8 +73,8 @@
"verify_uuid": "52bfac10394d49219385dcd4cc17177e",
"download_uuid": "52bfac10394d49219385dcd4cc17177r",
"name": "testcert",
"created_date": "2015-06-12 11:02:13",
"modified_date": "2015-06-12 11:02:13",
"created_date": "2015-06-12 11:02:13.007790+00:00",
"modified_date": "2015-06-12 11:02:13.007790+00:00",
"error_reason": "",
"mode": "honor"
}
@@ -93,8 +93,8 @@
"verify_uuid": "52bfac10394d49219385dcd4cc17177e",
"download_uuid": "52bfac10394d49219385dcd4cc17177r",
"name": "testcert",
"created_date": "2015-06-12 11:02:13",
"modified_date": "2015-06-12 11:02:13",
"created_date": "2015-06-12 11:02:13.007790+00:00",
"modified_date": "2015-06-12 11:02:13.007790+00:00",
"error_reason": "",
"mode": "honor"
}
@@ -103,7 +103,7 @@
"pk": 1,
"model": "student.linkedinaddtoprofileconfiguration",
"fields": {
"change_date": "2050-06-15 11:02:13",
"change_date": "2050-06-15 11:02:13.007790+00:00",
"changed_by": 99,
"enabled": true,
"dashboard_tracking_code": "edx-course-v1&TESTCOURSE",

View File

@@ -77,6 +77,9 @@ class BokChoyTestSuite(TestSuite):
if not self.testsonly:
self.prepare_bokchoy_run()
else:
# load data in db_fixtures
self.load_data()
msg = colorize('green', "Confirming servers have started...")
print msg
@@ -147,13 +150,8 @@ class BokChoyTestSuite(TestSuite):
bokchoy_utils.clear_mongo()
self.cache.flush_all()
sh(
"DEFAULT_STORE={default_store}"
" ./manage.py lms --settings bok_choy loaddata --traceback"
" common/test/db_fixtures/*.json".format(
default_store=self.default_store,
)
)
# load data in db_fixtures
self.load_data()
if self.imports_dir:
sh(
@@ -169,6 +167,19 @@ class BokChoyTestSuite(TestSuite):
print msg
bokchoy_utils.start_servers(self.default_store, self.coveragerc)
def load_data(self):
"""
Loads data into database from db_fixtures
"""
print 'Loading data from json fixtures in db_fixtures directory'
sh(
"DEFAULT_STORE={default_store}"
" ./manage.py lms --settings bok_choy loaddata --traceback"
" common/test/db_fixtures/*.json".format(
default_store=self.default_store,
)
)
def run_servers_continuously(self):
"""
Infinite loop. Servers will continue to run in the current session unless interrupted.

View File

@@ -28,7 +28,7 @@ DB_CACHE_DIR="common/test/db_cache"
echo "CREATE DATABASE IF NOT EXISTS edxtest;" | mysql -u root
# Clear out the test database
./manage.py lms --settings bok_choy reset_db --traceback --noinput
./manage.py lms --settings bok_choy flush --traceback --noinput
# If there are cached database schemas/data, load them
if [[ -f $DB_CACHE_DIR/bok_choy_schema.sql && -f $DB_CACHE_DIR/bok_choy_migrations_data.sql && -f $DB_CACHE_DIR/bok_choy_data.json ]]; then