Unverified Commit f54e9c15 by Saleem Latif Committed by GitHub

Merge pull request #512 from edx/saleem-latif/ENT-992

ENT-992:  Added additional fields in the analytics reports db
parents b5e5e344 7535df0e
...@@ -105,3 +105,60 @@ class ImportUserSocialAuthTask(ImportMysqlToHiveTableTask): ...@@ -105,3 +105,60 @@ class ImportUserSocialAuthTask(ImportMysqlToHiveTableTask):
('uid', 'STRING'), ('uid', 'STRING'),
('extra_data', 'STRING'), ('extra_data', 'STRING'),
] ]
class ImportVoucher(ImportMysqlToHiveTableTask):
"""
Ecommerce: Imports the voucher_voucher table from the ecommerce
database to a destination directory and a HIVE metastore.
A voucher is a discount coupon that can be applied to ecommerce purchases.
"""
@property
def table_name(self):
return 'voucher_voucher'
@property
def columns(self):
return [
('id', 'INT'),
('name', 'STRING'),
('code', 'STRING'),
('usage', 'STRING'),
('start_datetime', 'TIMESTAMP'),
('end_datetime', 'TIMESTAMP'),
('num_basket_additions', 'INT'),
('num_orders', 'INT'),
('total_discount', 'DECIMAL(12, 2)'),
('date_created', 'TIMESTAMP'),
]
class ImportStockRecord(ImportMysqlToHiveTableTask):
"""
Ecommerce: Imports the partner_stockrecord table from the ecommerce
database to a destination directory and a HIVE metastore.
A voucher is a discount coupon that can be applied to ecommerce purchases.
"""
@property
def table_name(self):
return 'partner_stockrecord'
@property
def columns(self):
return [
('id', 'INT'),
('partner_sku', 'STRING'),
('price_currency', 'STRING'),
('price_excl_tax', 'DECIMAL(12, 2)'),
('price_retail', 'DECIMAL(12, 2)'),
('cost_price', 'DECIMAL(12, 2)'),
('num_in_stock', 'INT'),
('num_allocated', 'INT'),
('low_stock_threshold', 'INT'),
('date_created', 'TIMESTAMP'),
('date_updated', 'TIMESTAMP'),
('partner_id', 'INT'),
('product_id', 'INT'),
]
...@@ -8,16 +8,19 @@ import luigi.task ...@@ -8,16 +8,19 @@ import luigi.task
from edx.analytics.tasks.common.mysql_load import MysqlInsertTask from edx.analytics.tasks.common.mysql_load import MysqlInsertTask
from edx.analytics.tasks.enterprise.enterprise_database_imports import ( from edx.analytics.tasks.enterprise.enterprise_database_imports import (
ImportDataSharingConsentTask, ImportEnterpriseCourseEnrollmentUserTask, ImportEnterpriseCustomerTask, ImportDataSharingConsentTask, ImportEnterpriseCourseEnrollmentUserTask, ImportEnterpriseCustomerTask,
ImportEnterpriseCustomerUserTask, ImportUserSocialAuthTask ImportEnterpriseCustomerUserTask, ImportStockRecord, ImportUserSocialAuthTask, ImportVoucher
) )
from edx.analytics.tasks.insights.database_imports import ( from edx.analytics.tasks.insights.database_imports import (
ImportAuthUserProfileTask, ImportAuthUserTask, ImportPersistentCourseGradeTask, ImportStudentCourseEnrollmentTask ImportAuthUserProfileTask, ImportAuthUserTask, ImportCurrentOrderDiscountState, ImportCurrentOrderLineState,
ImportCurrentOrderState, ImportPersistentCourseGradeTask, ImportProductCatalog, ImportStudentCourseEnrollmentTask
) )
from edx.analytics.tasks.insights.enrollments import OverwriteHiveAndMysqlDownstreamMixin from edx.analytics.tasks.insights.enrollments import OverwriteHiveAndMysqlDownstreamMixin
from edx.analytics.tasks.insights.user_activity import UserActivityTableTask from edx.analytics.tasks.insights.user_activity import UserActivityTableTask
from edx.analytics.tasks.util.decorators import workflow_entry_point from edx.analytics.tasks.util.decorators import workflow_entry_point
from edx.analytics.tasks.util.hive import BareHiveTableTask, HivePartitionTask, OverwriteAwareHiveQueryDataTask from edx.analytics.tasks.util.hive import BareHiveTableTask, HivePartitionTask, OverwriteAwareHiveQueryDataTask
from edx.analytics.tasks.util.record import BooleanField, DateField, DateTimeField, IntegerField, Record, StringField from edx.analytics.tasks.util.record import (
BooleanField, DateField, DateTimeField, FloatField, IntegerField, Record, StringField
)
from edx.analytics.tasks.warehouse.load_internal_reporting_course_catalog import ( from edx.analytics.tasks.warehouse.load_internal_reporting_course_catalog import (
CoursePartitionTask, LoadInternalReportingCourseCatalogMixin CoursePartitionTask, LoadInternalReportingCourseCatalogMixin
) )
...@@ -53,6 +56,11 @@ class EnterpriseEnrollmentRecord(Record): ...@@ -53,6 +56,11 @@ class EnterpriseEnrollmentRecord(Record):
course_key = StringField(length=255, description='') course_key = StringField(length=255, description='')
user_country_code = StringField(length=2, description='') user_country_code = StringField(length=2, description='')
last_activity_date = DateField(description='') last_activity_date = DateField(description='')
coupon_name = StringField(length=255, description='')
coupon_code = StringField(length=255, description='')
final_grade = FloatField(description='')
course_price = FloatField(description='')
discount_price = FloatField(description='')
class EnterpriseEnrollmentHiveTableTask(BareHiveTableTask): class EnterpriseEnrollmentHiveTableTask(BareHiveTableTask):
...@@ -135,7 +143,12 @@ class EnterpriseEnrollmentDataTask( ...@@ -135,7 +143,12 @@ class EnterpriseEnrollmentDataTask(
auth_user.username AS user_username, auth_user.username AS user_username,
course.catalog_course AS course_key, course.catalog_course AS course_key,
user_profile.country AS user_country_code, user_profile.country AS user_country_code,
user_activity.latest_date AS last_activity_date user_activity.latest_date AS last_activity_date,
ecommerce_voucher.name AS coupon_name,
ecommerce_voucher.code AS coupon_code,
grades.percent_grade AS final_grade,
ecommerce_stockrecord.price_excl_tax AS course_price,
ecommerce_order.total_incl_tax AS discount_price
FROM enterprise_enterprisecourseenrollment enterprise_course_enrollment FROM enterprise_enterprisecourseenrollment enterprise_course_enrollment
JOIN enterprise_enterprisecustomeruser enterprise_user JOIN enterprise_enterprisecustomeruser enterprise_user
ON enterprise_course_enrollment.enterprise_customer_user_id = enterprise_user.id ON enterprise_course_enrollment.enterprise_customer_user_id = enterprise_user.id
...@@ -182,6 +195,18 @@ class EnterpriseEnrollmentDataTask( ...@@ -182,6 +195,18 @@ class EnterpriseEnrollmentDataTask(
ON enterprise_user.user_id = social_auth.user_id ON enterprise_user.user_id = social_auth.user_id
JOIN course_catalog course JOIN course_catalog course
ON enterprise_course_enrollment.course_id = course.course_id ON enterprise_course_enrollment.course_id = course.course_id
JOIN catalogue_product ecommerce_catalogue_product
ON enterprise_course_enrollment.course_id = ecommerce_catalogue_product.course_id
LEFT JOIN order_line ecommerce_order_line
ON ecommerce_catalogue_product.id = ecommerce_order_line.product_id
JOIN partner_stockrecord ecommerce_stockrecord
ON ecommerce_order_line.stockrecord_id = ecommerce_stockrecord.id
LEFT JOIN order_order ecommerce_order
ON ecommerce_order_line.order_id = ecommerce_order.id
LEFT JOIN order_orderdiscount ecommerce_order_discount
ON ecommerce_order_line.order_id = ecommerce_order_discount.order_id
LEFT JOIN voucher_voucher ecommerce_voucher
ON ecommerce_order_discount.voucher_id = ecommerce_voucher.id
""" """
@property @property
...@@ -219,6 +244,12 @@ class EnterpriseEnrollmentDataTask( ...@@ -219,6 +244,12 @@ class EnterpriseEnrollmentDataTask(
overwrite_n_days=0, overwrite_n_days=0,
date=self.date date=self.date
), ),
ImportProductCatalog(),
ImportCurrentOrderLineState(),
ImportCurrentOrderDiscountState(),
ImportVoucher(),
ImportStockRecord(),
ImportCurrentOrderState(),
) )
......
--
-- Table structure for table `catalogue_product`
--
DROP TABLE IF EXISTS `catalogue_product`;
CREATE TABLE `catalogue_product` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`structure` varchar(10) NOT NULL,
`upc` varchar(64) DEFAULT NULL,
`title` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`rating` double DEFAULT NULL,
`date_created` datetime NOT NULL,
`date_updated` datetime NOT NULL,
`is_discountable` tinyint(1) NOT NULL,
`parent_id` int(11),
`product_class_id` int(11),
`course_id` varchar(255),
`expires` datetime,
PRIMARY KEY (`id`),
UNIQUE KEY `upc` (`upc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `catalogue_product`
--
INSERT INTO `catalogue_product` VALUES
(1,'parent',NULL,'A demonstration course','parent-demo-demox-democourse-1T2015','',NULL,'2015-08-06 19:06:21','2015-08-06 19:21:06',1,NULL,1,'edX/Open_DemoX/edx_demo_course',NULL),
(2,'child',NULL,'A demonstration course (ID verified)','demo-demox-democourse-1T2015-id-verified','',NULL,'2015-08-06 19:06:21','2015-08-06 19:21:06',1,1,NULL,'edX/Open_DemoX/edx_demo_course','2016-12-12 00:00:00'),
(3,'parent',NULL,'Seat in edX Demo Course 2','seat-in','',NULL,'2016-03-22 20:32:49.444111','2016-03-22 20:32:49.476687',1,NULL,1,'course-v1:edX+Open_DemoX+edx_demo_course2',NULL),
(4,'child',NULL,'Seat in edX Demo Course 2','seat-in-test-otto-verified-course','',NULL,'2016-03-22 20:32:49.520169','2016-03-22 20:32:49.520208',1,3,NULL,'course-v1:edX+Open_DemoX+edx_demo_course2',NULL),
(5,'child',NULL,'Seat in edX Demo Verified Course 2 with verified certificate (and ID verification)','seat-in-test-otto-verified-course-with-verified-certificate-and-id-verification','',NULL,'2016-03-22 20:32:49.582976','2016-03-22 20:32:49.583011',1,3,NULL,'course-v1:edX+Open_DemoX+edx_demo_course2+Verified',NULL),
(6,'parent',NULL,'Seat in edX Demo Professional Course 2','seat-in','',NULL,'2016-03-22 20:33:29.480679','2016-03-22 20:33:29.589327',1,NULL,1,'course-v1:edX+Open_DemoX+edx_demo_course2+Professional',NULL),
(7,'child',NULL,'Seat in edX Demo Professional Course with professional certificate','seat-in-test-otto-professional-course-with-professional-certificate','',NULL,'2016-03-22 20:33:29.609508','2016-03-22 20:33:29.609558',1,6,NULL,'course-v1:edX+Open_DemoX+edx_demo_course2+Professional',NULL),
(12,'standalone',NULL,'AccTest 25% off Otto Verified','578E9F3544','',NULL,'2016-03-22 20:44:23.266854','2016-03-22 20:44:23.310765',1,NULL,3,NULL,NULL),
(13,'standalone',NULL,'AccTest $200 off Otto Prof','92D741F650','',NULL,'2016-03-22 20:46:39.846749','2016-03-22 20:46:39.958757',1,NULL,3,NULL,NULL),
(14,'standalone',NULL,'AccTest Otto Pro Enroll Code','450483FB7B','',NULL,'2016-03-22 20:47:58.279367','2016-03-22 20:47:58.384073',1,NULL,3,NULL,NULL),
(15,'standalone',NULL,'AccTest 40% off Otto Credit','901A4FE566','',NULL,'2016-03-22 20:50:27.485071','2016-03-22 20:50:27.538182',1,NULL,3,NULL,NULL),
(16,'parent',NULL,'edX Test Course','parent-demo-edx-Testing-1T2017','',NULL,'2015-08-06 19:06:21','2015-08-06 19:21:06',1,NULL,1,'course-v1:edX+Testing102x+1T2017',NULL),
(17,'child',NULL,'edX Test Course (ID verified)','demo-edx-Testing-1T2017-id-verified','',NULL,'2015-08-06 19:06:21','2015-08-06 19:21:06',1,1,NULL,'course-v1:edX+Testing102x+1T2017','2016-12-12 00:00:00');
\ No newline at end of file
--
-- Table structure for table `order_line`
--
DROP TABLE IF EXISTS `order_line`;
CREATE TABLE `order_line` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`partner_name` varchar(128) NOT NULL,
`partner_sku` varchar(128) NOT NULL,
`partner_line_reference` varchar(128) NOT NULL,
`partner_line_notes` longtext NOT NULL,
`title` varchar(255) NOT NULL,
`upc` varchar(128) DEFAULT NULL,
`quantity` int(10) unsigned NOT NULL,
`line_price_incl_tax` decimal(12,2) NOT NULL,
`line_price_excl_tax` decimal(12,2) NOT NULL,
`line_price_before_discounts_incl_tax` decimal(12,2) NOT NULL,
`line_price_before_discounts_excl_tax` decimal(12,2) NOT NULL,
`unit_cost_price` decimal(12,2) DEFAULT NULL,
`unit_price_incl_tax` decimal(12,2) DEFAULT NULL,
`unit_price_excl_tax` decimal(12,2) DEFAULT NULL,
`unit_retail_price` decimal(12,2) DEFAULT NULL,
`status` varchar(255) NOT NULL,
`est_dispatch_date` date DEFAULT NULL,
`order_id` int(11) NOT NULL,
`partner_id` int(11),
`product_id` int(11),
`stockrecord_id` int(11),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `order_line`
--
INSERT INTO `order_line` VALUES
(1,'edX','D354B6A','','','Seat in edX Demo Course with verified certificate (and ID verification)','',1,256.00,256.00,256.00,256.00,NULL,256.00,256.00,NULL,'Complete',NULL,1,1,2,1),
(2,'edX','D354B6A','','','Seat in edX Demo Verified Course 2 with verified certificate (and ID verification)','',1,192.00,192.00,256.00,256.00,NULL,256.00,256.00,NULL,'Complete',NULL,2,1,5,2),
(3,'edX','CF9A708','','','Seat in edX Demo Professional Course 2 with professional certificate','',1,0.00,0.00,1000.00,1000.00,NULL,1000.00,1000.00,NULL,'Complete',NULL,3,1,7,3),
(4,'edX','CF9A708','','','Seat in edX Demo Professional Course with professional certificate certificate','',1,0.00,0.00,1000.00,1000.00,NULL,1000.00,1000.00,NULL,'Complete',NULL,4,1,4,3),
(5,'edX','CF9A708','','','Seat in Test Verified Course','',1,0.00,0.00,1000.00,1000.00,NULL,1000.00,1000.00,NULL,'Complete',NULL,5,1,17,3);
--
-- Table structure for table `order_order`
--
DROP TABLE IF EXISTS `order_order`;
CREATE TABLE `order_order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`number` varchar(128) NOT NULL,
`currency` varchar(12) NOT NULL,
`total_incl_tax` decimal(12,2) NOT NULL,
`total_excl_tax` decimal(12,2) NOT NULL,
`shipping_incl_tax` decimal(12,2) NOT NULL,
`shipping_excl_tax` decimal(12,2) NOT NULL,
`shipping_method` varchar(128) NOT NULL,
`shipping_code` varchar(128) NOT NULL,
`status` varchar(100) NOT NULL,
`guest_email` varchar(75) NOT NULL,
`date_placed` datetime NOT NULL,
`basket_id` int(11) DEFAULT NULL,
`billing_address_id` int(11) DEFAULT NULL,
`shipping_address_id` int(11),
`site_id` int(11),
`user_id` int(11),
PRIMARY KEY (`id`),
UNIQUE KEY `number` (`number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `order_order`
--
INSERT INTO `order_order` VALUES
(1,'EDX-100019','USD',156.00,256.00,0.00,0.00,'No shipping required','no-shipping-required','Complete','','2016-03-22 20:57:10.353473',19,NULL,NULL,1,38),
(2,'EDX-100020','USD',192.00,192.00,0.00,0.00,'No shipping required','no-shipping-required','Complete','','2016-03-22 20:59:58.292441',20,NULL,NULL,1,40),
(3,'EDX-100021','USD',10.00,0.00,0.00,0.00,'No shipping required','no-shipping-required','Complete','','2016-03-22 21:02:09.032234',21,NULL,NULL,1,38),
(4,'EDX-100022','USD',120.00,800.00,0.00,0.00,'No shipping required','no-shipping-required','Complete','','2016-03-22 21:04:08.048200',22,NULL,NULL,1,40),
(5,'EDX-100023','USD',60.00,60.00,0.00,0.00,'No shipping required','no-shipping-required','Complete','','2016-03-22 21:09:45.318743',23,NULL,NULL,1,38);
--
-- Table structure for table `order_orderdiscount`
--
DROP TABLE IF EXISTS `order_orderdiscount`;
CREATE TABLE `order_orderdiscount` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category` varchar(64) NOT NULL,
`offer_id` int(10) unsigned DEFAULT NULL,
`offer_name` varchar(128) NOT NULL,
`voucher_id` int(10) unsigned DEFAULT NULL,
`voucher_code` varchar(128) NOT NULL,
`frequency` int(10) unsigned DEFAULT NULL,
`amount` decimal(12,2) NOT NULL,
`message` longtext NOT NULL,
`order_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `order_orderdiscount`
--
INSERT INTO `order_orderdiscount` VALUES
(1,'Basket',1,'Catalog [4]-Percentage-25',1,'OTTO_VER_25_PCT_OFF',1,64.00,'',1),
(2,'Basket',2,'Catalog [5]-Percentage-100',2,'VFF5A4MVV5KMNSQE',1,100.00,'',2),
(3,'Basket',3,'Catalog [5]-Absolute-100',3,'OTTO_PRO_200_USD_OFF',1,200.00,'',3),
(4,'Basket',4,'Catalog [5]-Absolute-50',4,'OTTO_PRO_200_USD_OFF',1,200.00,'',4),
(5,'Basket',5,'Catalog [5]-Absolute-50',5,'OTTO_PRO_200_USD_OFF',1,200.00,'',5);
--
-- Table structure for table `partner_stockrecord`
--
DROP TABLE IF EXISTS `partner_stockrecord`;
CREATE TABLE `partner_stockrecord` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`partner_sku` varchar(128) NOT NULL,
`price_currency` varchar(12) NOT NULL,
`price_excl_tax` decimal(12,2) DEFAULT NULL,
`price_retail` decimal(12,2) DEFAULT NULL,
`cost_price` decimal(12,2) DEFAULT NULL,
`num_in_stock` int(10) unsigned DEFAULT NULL,
`num_allocated` int(11) DEFAULT NULL,
`low_stock_threshold` int(10) unsigned DEFAULT NULL,
`date_created` datetime(6) NOT NULL,
`date_updated` datetime(6) NOT NULL,
`partner_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `partner_stockrecord_partner_id_8441e010_uniq` (`partner_id`,`partner_sku`),
KEY `partner_stockrecord_product_id_62fd9e45_fk_catalogue_product_id` (`product_id`),
KEY `partner_stockrecord_9474e4b5` (`date_updated`)
) ENGINE=InnoDB AUTO_INCREMENT=203 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `partner_stockrecord`
--
INSERT INTO `partner_stockrecord` VALUES
(1,'68EFFFF','USD',300.00,NULL,NULL,NULL,NULL,NULL,'2017-06-07 18:42:40.561668','2018-01-17 21:19:17.146064',1,2),
(2,'8CF08E5','USD',100.00,NULL,NULL,NULL,NULL,NULL,'2017-06-07 18:42:40.592853','2018-01-17 21:19:17.111078',1,4),
(3,'D36213B','USD',200.00,NULL,NULL,NULL,NULL,NULL,'2017-06-08 20:02:29.482358','2017-06-08 20:02:29.482387',1,5),
(4,'2278263','USD',100.00,NULL,NULL,NULL,NULL,NULL,'2017-06-08 21:17:07.233266','2017-06-08 21:17:07.233296',1,7),
(5,'1D654A0','USD',100.00,NULL,NULL,NULL,NULL,NULL,'2017-06-12 09:04:57.693314','2017-06-12 09:04:57.693343',1,17);
--
-- Table structure for table `voucher_voucher`
--
DROP TABLE IF EXISTS `voucher_voucher`;
CREATE TABLE `voucher_voucher` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
`code` varchar(128) NOT NULL,
`usage` varchar(128) NOT NULL,
`start_datetime` datetime(6) NOT NULL,
`end_datetime` datetime(6) NOT NULL,
`num_basket_additions` int(10) unsigned NOT NULL,
`num_orders` int(10) unsigned NOT NULL,
`total_discount` decimal(12,2) NOT NULL,
`date_created` datetime(6) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=489 DEFAULT CHARSET=utf8;
INSERT INTO `voucher_voucher` VALUES
(1,'Pied Piper Discount','RNBL737ZAUJXUM6E','Multi-use','2017-06-01 00:00:00.000000','2025-08-31 00:00:00.000000',0,66,662.00,'2017-06-08 00:00:00.000000'),
(2,'Aviato ','PIPNJSUK33P7PTZH','Multi-use','2017-06-01 00:00:00.000000','2025-08-31 00:00:00.000000',0,2,200.00,'2017-06-08 00:00:00.000000'),
(3,'ENT - Email domain restricted','ENT10','Multi-use','2017-06-01 00:00:00.000000','2017-12-31 00:00:00.000000',0,1,0.00,'2017-06-12 00:00:00.000000'),
(4,'ENT - No restrictions','ENT20','Multi-use','2017-06-01 00:00:00.000000','2017-12-31 00:00:00.000000',0,1,20.00,'2017-06-12 00:00:00.000000'),
(5,'ENT - Discount','ENT21','Multi-use','2017-06-01 00:00:00.000000','2017-12-31 00:00:00.000000',0,1,20.00,'2017-06-12 00:00:00.000000');
...@@ -75,40 +75,40 @@ class EnterpriseEnrollmentAcceptanceTest(AcceptanceTestCase): ...@@ -75,40 +75,40 @@ class EnterpriseEnrollmentAcceptanceTest(AcceptanceTestCase):
datetime.datetime(2016, 3, 22, 20, 59, 12), 'verified', 1, '', 0, None, 'ron', 1, datetime.datetime(2016, 3, 22, 20, 59, 12), 'verified', 1, '', 0, None, 'ron', 1,
'All about acceptance testing!', datetime.datetime(2016, 6, 1, 0, 0), datetime.datetime(2016, 9, 1, 0, 0), 'All about acceptance testing!', datetime.datetime(2016, 6, 1, 0, 0), datetime.datetime(2016, 9, 1, 0, 0),
'self_paced', 'Self Paced', 3, 5, datetime.datetime(2015, 2, 12, 23, 14, 35), 'test2@example.com', 'self_paced', 'Self Paced', 3, 5, datetime.datetime(2015, 2, 12, 23, 14, 35), 'test2@example.com',
'test_user2', 'edX+Open_DemoX', 'US', None], 'test_user2', 'edX+Open_DemoX', 'US', None, 'ENT - No restrictions', 'ENT20', 0, 200.00, 120.00],
['03fc6c3a33d84580842576922275ca6f', '2nd Enterprise', 13, 3, 'course-v1:edX+Open_DemoX+edx_demo_course2', ['03fc6c3a33d84580842576922275ca6f', '2nd Enterprise', 13, 3, 'course-v1:edX+Open_DemoX+edx_demo_course2',
datetime.datetime(2016, 3, 22, 21, 2, 9), 'no-id-professional', 1, '', 0, None, 'hermione', 1, datetime.datetime(2016, 3, 22, 21, 2, 9), 'no-id-professional', 1, '', 0, None, 'hermione', 1,
'All about acceptance testing!', datetime.datetime(2016, 6, 1, 0, 0), datetime.datetime(2016, 9, 1, 0, 0), 'All about acceptance testing!', datetime.datetime(2016, 6, 1, 0, 0), datetime.datetime(2016, 9, 1, 0, 0),
'self_paced', 'Self Paced', 3, 5, datetime.datetime(2015, 2, 12, 23, 14, 35), 'test3@example.com', 'self_paced', 'Self Paced', 3, 5, datetime.datetime(2015, 2, 12, 23, 14, 35), 'test3@example.com',
'test_user3', 'edX+Open_DemoX', 'US', datetime.date(2015, 9, 9)], 'test_user3', 'edX+Open_DemoX', 'US', datetime.date(2015, 9, 9), 'ENT - No restrictions', 'ENT20', 0.03, 200.00, 120.00],
['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 11, 1, 'course-v1:edX+Open_DemoX+edx_demo_course2', ['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 11, 1, 'course-v1:edX+Open_DemoX+edx_demo_course2',
datetime.datetime(2016, 3, 22, 20, 56, 9), 'verified', 1, '', 0, None, 'harry', 1, datetime.datetime(2016, 3, 22, 20, 56, 9), 'verified', 1, '', 0, None, 'harry', 1,
'All about acceptance testing!', datetime.datetime(2016, 6, 1, 0, 0), datetime.datetime(2016, 9, 1, 0, 0), 'All about acceptance testing!', datetime.datetime(2016, 6, 1, 0, 0), datetime.datetime(2016, 9, 1, 0, 0),
'self_paced', 'Self Paced', 3, 5, datetime.datetime(2015, 2, 12, 23, 14, 35), 'test@example.com', 'self_paced', 'Self Paced', 3, 5, datetime.datetime(2015, 2, 12, 23, 14, 35), 'test@example.com',
'test_user', 'edX+Open_DemoX', 'US', None], 'test_user', 'edX+Open_DemoX', 'US', None, 'ENT - No restrictions', 'ENT20', 0.4, 200.00, 120.00],
['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 12, 2, 'course-v1:edX+Testing102x+1T2017', ['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 12, 2, 'course-v1:edX+Testing102x+1T2017',
datetime.datetime(2016, 3, 22, 21, 4, 8), 'no-id-professional', 1, 'Pass', 1, datetime.datetime(2016, 3, 22, 21, 4, 8), 'no-id-professional', 1, 'Pass', 1,
datetime.datetime(2017, 5, 9, 16, 27, 34), 'ron', 1, 'All about acceptance testing Part 3!', datetime.datetime(2017, 5, 9, 16, 27, 34), 'ron', 1, 'All about acceptance testing Part 3!',
datetime.datetime(2016, 12, 1, 0, 0), datetime.datetime(2017, 2, 1, 0, 0), 'instructor_paced', '9', 2, 5, datetime.datetime(2016, 12, 1, 0, 0), datetime.datetime(2017, 2, 1, 0, 0), 'instructor_paced', '9', 2, 5,
datetime.datetime(2015, 2, 12, 23, 14, 35), 'test2@example.com', 'test_user2', 'edX+Testing102', datetime.datetime(2015, 2, 12, 23, 14, 35), 'test2@example.com', 'test_user2', 'edX+Testing102',
'US', datetime.date(2015, 9, 9)], 'US', datetime.date(2015, 9, 9), 'ENT - Discount', 'ENT21', 0.98, 200, 60.00],
['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 11, 1, 'course-v1:edX+Testing102x+1T2017', ['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 11, 1, 'course-v1:edX+Testing102x+1T2017',
datetime.datetime(2016, 3, 22, 21, 8, 8), 'credit', 0, '', 0, None, 'harry', 1, datetime.datetime(2016, 3, 22, 21, 8, 8), 'credit', 0, '', 0, None, 'harry', 1,
'All about acceptance testing Part 3!', datetime.datetime(2016, 12, 1, 0, 0), 'All about acceptance testing Part 3!', datetime.datetime(2016, 12, 1, 0, 0),
datetime.datetime(2017, 2, 1, 0, 0), 'instructor_paced', '9', 2, 5, datetime.datetime(2017, 2, 1, 0, 0), 'instructor_paced', '9', 2, 5,
datetime.datetime(2015, 2, 12, 23, 14, 35), 'test@example.com', 'test_user', 'edX+Testing102', datetime.datetime(2015, 2, 12, 23, 14, 35), 'test@example.com', 'test_user', 'edX+Testing102',
'US', datetime.date(2015, 9, 9)], 'US', datetime.date(2015, 9, 9), 'ENT - Discount', 'ENT21', 0.64, 200.00, 60.00],
['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 11, 1, 'edX/Open_DemoX/edx_demo_course', ['0381d3cb033846d48a5cb1475b589d7f', 'Enterprise 1', 11, 1, 'edX/Open_DemoX/edx_demo_course',
datetime.datetime(2014, 6, 27, 16, 2, 38), 'verified', 1, 'Pass', 1, datetime.datetime(2014, 6, 27, 16, 2, 38), 'verified', 1, 'Pass', 1,
datetime.datetime(2017, 5, 9, 16, 27, 35), 'harry', 1, 'All about acceptance testing!', datetime.datetime(2017, 5, 9, 16, 27, 35), 'harry', 1, 'All about acceptance testing!',
datetime.datetime(2016, 9, 1, 0, 0), datetime.datetime(2016, 12, 1, 0, 0), 'instructor_paced', '13', 2, 4, datetime.datetime(2016, 9, 1, 0, 0), datetime.datetime(2016, 12, 1, 0, 0), 'instructor_paced', '13', 2, 4,
datetime.datetime(2015, 2, 12, 23, 14, 35), 'test@example.com', 'test_user', 'edX+Open_DemoX', datetime.datetime(2015, 2, 12, 23, 14, 35), 'test@example.com', 'test_user', 'edX+Open_DemoX',
'US', None], 'US', None, 'Pied Piper Discount', 'RNBL737ZAUJXUM6E', 0.81, 300.00, 156.00],
] ]
return [tuple(row) for row in expected] return [tuple(row) for row in expected]
...@@ -120,7 +120,8 @@ class EnterpriseEnrollmentAcceptanceTest(AcceptanceTestCase): ...@@ -120,7 +120,8 @@ class EnterpriseEnrollmentAcceptanceTest(AcceptanceTestCase):
'has_passed', 'passed_timestamp', 'enterprise_sso_uid', 'enterprise_site_id', 'course_title', 'has_passed', 'passed_timestamp', 'enterprise_sso_uid', 'enterprise_site_id', 'course_title',
'course_start', 'course_end', 'course_pacing_type', 'course_duration_weeks', 'course_min_effort', 'course_start', 'course_end', 'course_pacing_type', 'course_duration_weeks', 'course_min_effort',
'course_max_effort', 'user_account_creation_timestamp', 'user_email', 'user_username', 'course_key', 'course_max_effort', 'user_account_creation_timestamp', 'user_email', 'user_username', 'course_key',
'user_country_code', 'last_activity_date'] 'user_country_code', 'last_activity_date', 'coupon_name', 'coupon_code', 'final_grade',
'course_price', 'discount_price']
with self.export_db.cursor() as cursor: with self.export_db.cursor() as cursor:
cursor.execute( cursor.execute(
''' '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment