不要怂,就是干,撸起袖子干!

Commit bda41a8f by Mick Hansen

fix tests to reflect more consistent use of non-integer/non-id primary keys and …

…alias as foreign key identifiers
1 parent da9fdd6b
...@@ -462,7 +462,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -462,7 +462,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
self.User.belongsTo(self.Group) self.User.belongsTo(self.Group)
self.sequelize.sync({ force: true }).success(function() { self.sequelize.sync({ force: true }).success(function() {
self.User.create({ username: 'someone', GroupPKeagerbelongId: 'people' }).success(function() { self.User.create({ username: 'someone', GroupPKeagerbelongName: 'people' }).success(function() {
self.Group.create({ name: 'people' }).success(function() { self.Group.create({ name: 'people' }).success(function() {
self.User.find({ self.User.find({
where: { where: {
...@@ -604,7 +604,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -604,7 +604,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
self.Group.hasOne(self.User) self.Group.hasOne(self.User)
self.sequelize.sync({ force: true }).success(function() { self.sequelize.sync({ force: true }).success(function() {
self.User.create({ username: 'someone', GroupPKeageroneId: 'people' }).success(function() { self.User.create({ username: 'someone', GroupPKeageroneName: 'people' }).success(function() {
self.Group.create({ name: 'people' }).success(function() { self.Group.create({ name: 'people' }).success(function() {
self.Group.find({ self.Group.find({
where: { where: {
......
...@@ -921,8 +921,8 @@ describe(Support.getTestDialectTeaser("DAO"), function () { ...@@ -921,8 +921,8 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
overdue_days: DataTypes.INTEGER overdue_days: DataTypes.INTEGER
}, { timestamps: false }) }, { timestamps: false })
this.UserEager.hasMany(this.ProjectEager, { as: 'Projects' }) this.UserEager.hasMany(this.ProjectEager, { as: 'Projects', foreignKey: 'PoobahId' })
this.ProjectEager.belongsTo(this.UserEager, { as: 'Poobah' }) this.ProjectEager.belongsTo(this.UserEager, { as: 'Poobah', foreignKey: 'PoobahId' })
self.UserEager.sync({force: true}).success(function() { self.UserEager.sync({force: true}).success(function() {
self.ProjectEager.sync({force: true}).success(function() { self.ProjectEager.sync({force: true}).success(function() {
...@@ -1062,8 +1062,8 @@ describe(Support.getTestDialectTeaser("DAO"), function () { ...@@ -1062,8 +1062,8 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
this.Project = this.sequelize.define('NiceProject', { title: DataTypes.STRING }, { timestamps: false }) this.Project = this.sequelize.define('NiceProject', { title: DataTypes.STRING }, { timestamps: false })
this.User.hasMany(this.Project, { as: 'Projects' }) this.User.hasMany(this.Project, { as: 'Projects', foreignKey: 'lovelyUserId' })
this.Project.belongsTo(this.User, { as: 'LovelyUser' }) this.Project.belongsTo(this.User, { as: 'LovelyUser', foreignKey: 'lovelyUserId' })
this.User.sync({ force: true }).success(function() { this.User.sync({ force: true }).success(function() {
self.Project.sync({ force: true }).success(function() { self.Project.sync({ force: true }).success(function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!