text: import psycopg2
  
  url = "dbname='rafiki_tests' user='postgres' host='localhost' port=5432 password='Boywonder47'"
  
  class test_database_setup(object):
  
      def __init__(self):
          self.conn = psycopg2.connect(url)
          self.cursor = self.conn.cursor()
  
      def destroy_tables(self):
          self.cursor.execute("""DROP TABLE IF EXISTS user CASCADE;""")
          self.conn.commit()
  
      def test_create_tables(self):
          self.cursor.execute("""CREATE TABLE IF NOT EXISTS Users (
              user_id SERIAL NOT NULL,
              name VARCHAR(50) NOT NULL,
              post_date DATE NOT NULL DEFAULT CURRENT_DATE,
              email VARCHAR(50)  UNIQUE NOT NULL,
              password VARCHAR(256) NOT NULL,
              photo VARCHAR(255) NOT NULL,
              PRIMARY KEY (email)
              );""")
  
  
          self.cursor.execute("""CREATE TABLE IF NOT EXISTS Share (
              share_id SERIAL NOT NULL,
              story TEXT NOT NULL,
              post_date DATE NOT NULL DEFAULT CURRENT_DATE,
              email VARCHAR(50) REFERENCES Users(email) NOT NULL,
              PRIMARY KEY (share_id)
              );""")
  
          self.cursor.execute("""CREATE TABLE IF NOT EXISTS Comments (
              comment_id SERIAL NOT NULL,
              comment TEXT NOT NULL,
              postedon DATE NOT NULL DEFAULT CURRENT_DATE,
              email VARCHAR(50) REFERENCES Users(email),
              share_id INT REFERENCES Share(share_id),
              PRIMARY KEY (comment_id)
  
              );""")
  
  
          self.cursor.execute("""CREATE TABLE IF NOT EXISTS appointment
           (
              session_id SERIAL NOT NULL,
              session_date INT NOT NULL,
              email VARCHAR(50) REFERENCES Users(email),
              PRIMARY KEY (session_id)
  
              );""")
  
          self.cursor.execute("""CREATE TABLE IF NOT EXISTS meeting (
              meeting_id SERIAL NOT NULL,
              session_id INT REFERENCES appointment(session_id),
              patient VARCHAR(50) NOT NULL,
              patient_email VARCHAR(50) NOT NULL,
              PRIMARY KEY (meeting_id)
              );""")
  
          self.cursor.execute("""CREATE TABLE IF NOT EXISTS detail (
              detail_id SERIAL NOT NULL,
              specialties VARCHAR(50) NOT NULL,
              languages VARCHAR(50) NOT NULL,
              email VARCHAR(50) REFERENCES Users(email),
              certification VARCHAR(250) NOT NULL,
              training VARCHAR(250) NOT NULL,
              gender VARCHAR(25) NOT NULL,
              bio TEXT NOT NULL,
              isRafiki BOOLEAN NOT NULL,
              PRIMARY KEY (detail_id)
              );""")
  
  
          self.cursor.execute("""CREATE TABLE IF NOT EXISTS blog (
              blog_id SERIAL NOT NULL,
              blog TEXT NOT NULL,
              media TEXT,
              post_date DATE NOT NULL DEFAULT CURRENT_DATE,
              email VARCHAR(50) REFERENCES Users(email) NOT NULL,
              PRIMARY KEY (blog_id)
              );""")
  
  
  
          self.conn.commit()
  