Skip to content

Commit

Permalink
Update tests because modulestates are populated by archive initdb
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc committed Aug 3, 2016
1 parent 5a9e30f commit 97923e1
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 51 deletions.
10 changes: 0 additions & 10 deletions cnxpublishing/tests/scripts/test_post_publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@ def setUp(self, cursor):
archive_initdb(archive_settings)
initdb(self.db_conn_str)

# Insert modulestates
cursor.execute("""\
INSERT INTO modulestates (stateid, statename) VALUES
(0, 'unknown'),
(1, 'current'),
(4, 'obsolete'),
(5, 'post-publication'),
(6, 'processing'),
(7, 'errored');""")

def tearDown(self):
# Terminate the post publication worker script.
if self.process.is_alive():
Expand Down
10 changes: 0 additions & 10 deletions cnxpublishing/tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ def setUp(self, cursor):
from openstax_accounts.stub import main
main(self.config)

# Insert modulestates
cursor.execute("""\
INSERT INTO modulestates (stateid, statename) VALUES
(0, 'unknown'),
(1, 'current'),
(4, 'obsolete'),
(5, 'post-publication'),
(6, 'processing'),
(7, 'errored');""")

def tearDown(self):
with psycopg2.connect(self.db_conn_str) as db_conn:
with db_conn.cursor() as cursor:
Expand Down
19 changes: 0 additions & 19 deletions cnxpublishing/tests/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ def setUp(self):
initdb(self.db_conn_str)
self.config = testing.setUp(settings=self.settings)

# Insert modulestates
with self.db_connect() as db_conn:
with db_conn.cursor() as cursor:
cursor.execute("""\
INSERT INTO modulestates (stateid, statename)
VALUES (1, 'current')""")

def tearDown(self):
with psycopg2.connect(self.db_conn_str) as db_conn:
with db_conn.cursor() as cursor:
Expand Down Expand Up @@ -492,18 +485,6 @@ def setUp(self):
initdb(self.db_conn_str)
self.config = testing.setUp(settings=self.settings)

# Insert modulestates
with psycopg2.connect(self.db_conn_str) as db_conn:
with db_conn.cursor() as cursor:
cursor.execute("""\
INSERT INTO modulestates (stateid, statename) VALUES
(0, 'unknown'),
(1, 'current'),
(4, 'obsolete'),
(5, 'post-publication'),
(6, 'processing'),
(7, 'errored');""")

def tearDown(self):
with psycopg2.connect(self.db_conn_str) as db_conn:
with db_conn.cursor() as cursor:
Expand Down
12 changes: 0 additions & 12 deletions cnxpublishing/tests/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,6 @@ def setUp(self):
# Assign API keys for testing
self.set_up_api_keys()

# Insert modulestates
with self.db_connect() as db_conn:
with db_conn.cursor() as cursor:
cursor.execute("""\
INSERT INTO modulestates (stateid, statename) VALUES
(0, 'unknown'),
(1, 'current'),
(4, 'obsolete'),
(5, 'post-publication'),
(6, 'processing'),
(7, 'errored');""")

def tearDown(self):
with self.db_connect() as db_conn:
with db_conn.cursor() as cursor:
Expand Down

0 comments on commit 97923e1

Please sign in to comment.