def test_room(self): r = Room(room_id=1234) r.save() s = Song(room=r) #s.save() self.assertEqual(str(s.room),str(r.room_id))
def test_add_time(self): r = Room(room_id=1234) r.save() d = "Hello" h = History(link="1234",add_time = d,room = r) with self.assertRaises(ValidationError): h.save()
def testlink(self): r = Room(room_id=1234) r.save() d = datetime.now() h = History(link=1234,add_time = d,room = r) h.save() self.assertRaises(ValueError,h.save())
def testRoom(self): r = Room(room_id=1234) r.save() d = datetime.now() h = History(link="test",add_time = d,room = r) h.save() self.assertTrue(1 == 1)
def test_guest_joins_room_response(self): """Test guest joins existing room""" r = Room(room_id = "12345") r.save() response = self.client.get(reverse('join a room',kwargs={'room_id':12345}), follow = True) self.assertEqual(response.status_code, 200)
def create_a_new_room(id,song_lim = DEFAULT_SONG_LIMIT): new_room = Room(room_id = id, song_limit = song_lim) new_room.save() return new_room