2018-02-07 16:44:59 +00:00
|
|
|
const assert = require('assert');
|
|
|
|
const frappe = require('frappejs');
|
|
|
|
const helpers = require('./helpers');
|
|
|
|
|
2018-02-08 06:46:38 +00:00
|
|
|
describe('Number Series', () => {
|
2018-02-07 16:44:59 +00:00
|
|
|
before(async function() {
|
|
|
|
await helpers.init_sqlite();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should start a series and get next value', async () => {
|
|
|
|
frappe.db.delete('Number Series', 'test-series-')
|
|
|
|
assert.equal(await frappe.model.get_series_next('test-series-'), 'test-series-1');
|
|
|
|
assert.equal(await frappe.model.get_series_next('test-series-'), 'test-series-2');
|
|
|
|
assert.equal(await frappe.model.get_series_next('test-series-'), 'test-series-3');
|
|
|
|
});
|
|
|
|
});
|